Hi I'm not sure if this is the right place to ask this.(If there is a better place to ask it let me know)
Anyway I'm making my own version of wii plays tanks game and I'm having difficulties with the Enemy tanks and how to get them to move towards the player and fire whilst evading walls and objects
All i can manage is for him to point at the player and move towards it which results in him running into a wall, firing and killing himself:P.
Any ideas and thoughts would be appreciated.
Offline
It depends on the script you use for the tank, really. But I came up with this, if you find it useful:
Last edited by technoguyx (2009-04-19 23:32:29)
Offline
Thanks for that it's quite helpful didn't think of making it stop a certain distance away or take a random time to fire (I like that idea).
Any idea on how to make it evade walls? and only shoot when there is line of sight so it doesn't try to shoot you through a wall
Offline
Completen00b wrote:
Thanks for that it's quite helpful didn't think of making it stop a certain distance away or take a random time to fire (I like that idea).
Any idea on how to make it evade walls? and only shoot when there is line of sight so it doesn't try to shoot you through a wall
You could use another, hidden sprite. And then, use the "color [] touching []?" block.
Let's say you make the sprite some sort of hidden laser, measuring about 50 pixels (since that's the distance to shoot), and you make it red. Then you'd use this on it:
But now, it should move away when it detects a wall. That sounds hard to me
Maybe a variable could help, only when that variable is set to 1, run the "following player" script. When it's set to 0, the AI turns away.
Offline
That idea works really well thanks for that I have 1 more problem tho,
Never mind i figured it out
Last edited by Completen00b (2009-04-21 22:05:47)
Offline