Omnimaga
Calculator Community => TI Calculators => Axe => Topic started by: Keoni29 on October 26, 2011, 05:10:25 am
-
I want my enemies to have some sort of AI movement. They will have to move toward the player and wander off when they don't see him or at random. They will have to shoot bullets too. I need only 4 enemies per screen. Some enemies shoot, some don't
Has anyone made something similar yet?
I don't want this game to become too heavy for older calculators. Compability is key to success ^-^
-
I think DualBLDR created a zombie game. http://ourl.ca/13361
But I don't know if they move to the player.
-
I think you are the "missile" and you have to avoid the zombies to reach the smiley. The zombies spawn in ramdomly and follow a random direction with a given speed. The random direction changes liek every 10 steps or so.
My enemies will have to "see" the player's position and then run in that direction. After 20-40 steps or so the direction randomizes and it follows that direction for 20-40 steps. So the enemies run blindly at the player. They do not change direction when the player moves. This is because you have to be able to dodge em. Enemies bounce off walls.
-
I've been piecing together a sort of AI for Essence, it's been a while but this (http://ourl.ca/12242) has a sort of pseudocode that attempts to direct the AI at the player.
It doesn't have the wandering around/running, just blindly running toward the player, but blarg :P
-
Woah that's a huge pseudocode. Maybe this is a little easier:
if player at the left
hspeed=-x
End
if player at the right
hspeed=x
End
if player above
vspeed=-x
End
if player below
vspeed=x
End
And for the random wandering:
hspeed=random(0-2)
vspeed=random(0-2)
And for the bouncing:
if moving to the left
if there is a solid tile to the left
bounce to right
End
End
if moving to the left
if there is a solid tile to the left
bounce to left
End
End
if moving up
if there is a solid tile above
bounce down
End
End
if moving down
if there is a solid tile beneath
bounce up
End
End
This might work :D