View Full Version : Shooting an enemy
I want to implement code to shoot an enemy in Opengl. How do I figure out the position of the enemy once I have moved? In other words, how do you figure out the position of objects in the world after transformations to the user? Any help would be appreciated.
04-14-2001, 02:34 AM
That is no question to post here...
You've got worldspace position of user?
+ You've got worldspace position of enemies?
Where is the problem?
04-14-2001, 03:25 AM
The problem is that vibi seems to insist on posting (pretty much the same) off topic questions here.
Here is a better place to ask these types of (non-OpenGL) questions:
04-14-2001, 08:28 PM
To me It souds like you are not using world space coordinates.
Make sure you store x,y pos for the main char +
diriection vector of main char.
store x,y pos of enemies.
when you draw the screen draw always the x,y pos of the main char
when you move the char alter it x,y pos (dont just call glTranslatef)
With this info the rest is simple maths.
This is a seriosly simple question to ask, Get a few good
books on graphics programming and reed them. Learning purley
on the internet can be difficult.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.