Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / AI trubble (DBPro)

Author
Message
Mr X
19
Years of Service
User Offline
Joined: 25th Sep 2005
Location: Universe, milkyway, sol-system, Earth...
Posted: 25th Jun 2006 13:51 Edited at: 26th Jun 2006 15:47
Im working on a simple game, where two ships move back and forth over the screen and fire on each other. There also exist two blocks, that blocks the bullets. This is something the AI is having trubble with. Im trying to make so it dont fire when there is an block between the two players. But I cant. The following code SHOULD do it. AI fiering:
. The function that checks if its a clear shot:
. Any ideas about whats wrong?
Hippie Dude
19
Years of Service
User Offline
Joined: 6th Feb 2005
Location: California, United States
Posted: 26th Jun 2006 18:59
Are you doing it in DBP or DBC. Also try not putting it as a function. Try putting it in your code.

Mysteries Surround You
Mr X
19
Years of Service
User Offline
Joined: 25th Sep 2005
Location: Universe, milkyway, sol-system, Earth...
Posted: 27th Jun 2006 14:45
Its dbpro (I put it in the topic title). However I just solved the problem (I used an entierly other method). But Im curius, why not use functions? They work perfect for me.
Dream And Death
18
Years of Service
User Offline
Joined: 21st Feb 2006
Location: The circus! Juggling job, kids and DBPro
Posted: 27th Jun 2006 15:57
Mr X: Ignore Hippie Dude - functions are the best way to program things. I haven't checked your code above, but were you passing all the parameters that the function needed? Or were they global?
Mr X
19
Years of Service
User Offline
Joined: 25th Sep 2005
Location: Universe, milkyway, sol-system, Earth...
Posted: 27th Jun 2006 18:18
Ive changed the code to something completly different that worked much better... and that was much simpler as well. Thats the charm with programming, you can do everything in a million ways.

Quote: "Ignore Hippie Dude - functions are the best way to program things."


I think youre right. Functions rock!

Login to post a reply

Server time is: 2024-11-26 17:36:05
Your offset time is: 2024-11-26 17:36:05