Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Space Race
#9
Well... for starters... on the surface, the games runs as it should, which is cool...

I am however impressed by how you "simplified" the code. Brilliant! Your understanding of how Naalaa implements arrays/tables is obviously much better than mine... Very nicely done! You realize that I am going to go over your code to see "what makes it tick"? lol I still have a LOT to learn...

You were right when you said the computer runs in to rocks most of the time... I am currently prototyping a "little something" that may (or may not) give the human a bit of a challenge. A kind of "early warning" or simple "avoidance" routine for the computer... more later... assuming I can get it to work... lol

Anyway... Very impressed by what you have accomplished! Well done!

J

Ok... Prototype seems to work... Tested the routine and it seems to be working...

How the routine works:

I used a simple circle/circle collision detection function to calculate the distance between the computer's ship and the rocks. If the ship is within 24 pixels of the rock, then reverse the computers thrust (making it move backwards), then continue moving forward. Because the computer automatically avoids the rocks, it is somewhat slowed down, it would be fair to reduce the human's overall speed to make it more of a challenge.


.n7   spacerace_avoidance.n7 (Size: 6.76 KB / Downloads: 7)

There still needs to be more tests but the initial few runs went without error... Feel free to modify or remove (will not be offended... But, if you do remove it, you will be struck from my Xmas list... Nah. Kidding. I do not have a Xmas list... lol)
Logic is the beginning of wisdom.
Reply


Messages In This Thread
Space Race - by johnno56 - 12-13-2023, 07:20 PM
RE: Space Race - by 1micha.elok - 12-14-2023, 04:23 AM
RE: Space Race - by johnno56 - 12-14-2023, 06:45 AM
RE: Space Race - by Marcus - 12-19-2023, 06:23 AM
RE: Space Race - by 1micha.elok - 12-20-2023, 03:50 AM
RE: Space Race - by kevin - 12-15-2023, 03:14 PM
RE: Space Race - by johnno56 - 12-15-2023, 06:37 PM
RE: Space Race - by johnno56 - 12-19-2023, 10:01 AM
RE: Space Race - by johnno56 - 12-20-2023, 07:38 AM
RE: Space Race - by 1micha.elok - 12-22-2023, 08:54 AM
RE: Space Race - by johnno56 - 12-22-2023, 10:53 AM
RE: Space Race - by Marcus - 12-23-2023, 09:40 PM
RE: Space Race - by johnno56 - 12-24-2023, 07:07 AM

Forum Jump:


Users browsing this thread: 4 Guest(s)