Computer Science Canada trouble with moving mutiple "AI" |
Author: | caldrium [ Wed Jan 18, 2006 7:10 pm ] | ||
Post subject: | trouble with moving mutiple "AI" | ||
I have a few problems (and sorry for the messy program ill give it a tweak in a bit): 1. the cls is also deleting the spawned fish (see the proc fishSpawn) 2. i want the fish to move from right to left (they spawn at right[but then disapear due to the cls thing]) 3. lastly even with View.Update (maybe its in a bad spot, maybe it doesnt matter) it still flashes a bit, and im assuming it will probably get worse with the new fishes come in Help would be greatly appreciated. (sorry for all these posts) im terrible at this stuff and i gotta hand in a major project for next week :S
|
Author: | zylum [ Wed Jan 18, 2006 8:57 pm ] |
Post subject: | |
uh huh... looks like you dont have any of the basics down. id recommend reading up on arrays, records and procedures. as for the flickering, you need to set your screen to offscreenonly at the beginning of the program. the syntax would be: setscreen("offscreenonly") or if you prefer View.Set ("offscreenonly") |
Author: | sylvester-27 [ Thu Jan 19, 2006 1:10 pm ] |
Post subject: | |
i agree. also your fishy's aren't actually ai's. Or atleast you don't have to go to the trouble of making them ai's. All you have to do is have them move across the screen (-1) +1 if your going the other way. Then just have your "fish" (suggestion: actually draw some fish use a drawoval and a drawpolygon) move across the screen and recognize when they have hit u. |
Author: | codemage [ Thu Jan 19, 2006 2:09 pm ] |
Post subject: | |
You only want to spawn your fish once per round. Otherwise, you want them to move left once every time in the loop. Once they get to a certain spot (x < 0 or somesuch), then respawn them again. |
Author: | caldrium [ Thu Jan 19, 2006 4:08 pm ] | ||
Post subject: | |||
well.. i just want them to move from right to left then dissapear, but i dun know how to put them into the loop without dissapearing, im thinking its gotta be done with an array, but im not for sure... can someone tell me how to set them up if you want to get it check my game so far: i remmed the fish stuff out so you dun have to download the graphics, and sorry for my program being in a complete mess.
|