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.
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)
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.
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.