Hi dudes!
How do you implement NPC (non-playable character) with box2d in a 2d platform game?
I have 2 ideas, what do you think?
1st. Put 2 points (start and end) in my level editor and when exceed, just turn around.
2nd. Use a ray and if I detect there is no platform (or there is a wall), NPC turn around.
How do you suggest I move my NPCs? ApplyImpulse? ApplyForce? SetLinearSpeed?
If I use ApplyForce every Update call, they will accelerate to the infinity and beyond.
SetLinearSpeed violates the actual physic simulation.
What do you think?
Thanks for help.
How do you implement NPC (non-playable character) with box2d in a 2d platform game?
I have 2 ideas, what do you think?
1st. Put 2 points (start and end) in my level editor and when exceed, just turn around.
2nd. Use a ray and if I detect there is no platform (or there is a wall), NPC turn around.
How do you suggest I move my NPCs? ApplyImpulse? ApplyForce? SetLinearSpeed?
If I use ApplyForce every Update call, they will accelerate to the infinity and beyond.
SetLinearSpeed violates the actual physic simulation.
What do you think?
Thanks for help.