PDA

View Full Version : Qt game programming: How to pinpoint location?



qtkid
8th June 2011, 03:26
Hi everyone,

I need to create a game that my character has to be targeted by some enemies. How do i go about doing that? Right now i only know how to create random movements of the enemies. Any help will be appreciated. Thanks!



-qtkid

Santosh Reddy
8th June 2011, 06:01
First thing, Don't know how this is related to Qt, so not relevant post in this forum.

Just to give a thought, you need to come with a strategy (which enemy use to approach your character), I mean do they all come in a sequence one behind another, or come in 2/4/5/n different direction, do the come with same speed, do all them have same arms / ammunition.

So as you know how to create random movements, your random movement generator will have the target point (your character location) as a constraint, and every next random movement should either bring enemy closer in distance to character, or bring enemy in safer (hide) location, or should attack the character. If the random movement is not meeting the constraints it ignored and next random movement is considered... so on...

I just have a feeling of having played your game:)