Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / sprite based target reticules

Author
Message
stoned coder
18
Years of Service
User Offline
Joined: 6th May 2007
Location:
Posted: 11th May 2007 06:14
can any one help me with my sprite target reticules.I have ,at the moment, used the object screen x (and y) commands ,which works fine if the object is in screen.But when the object is behind the camera the sprite appears in the center of screen! this means that if you follow the sprite it will lead you away from the object, but i want a reticule that will lead you to the object when you follow it not just when your facing it( just like the ones in Eve Online !) ie when the object is off screen (behind ,right for example) the sprite needs to be shown on the right side edge of the screen (but still move up and down to indicate objects y position)and viceversa.If anyone has done this already could you share the code please? I have looked ,but if my searches missed something can u give me the topic title so i can.
Thanks.
diseased
21
Years of Service
User Offline
Joined: 16th Aug 2003
Location:
Posted: 7th Aug 2007 21:42
are you talking about an enemy-pointer-outer type reticule, as in one that will put a small arrow on the side of the screen if the enemy is off to the side or behind the player?

fist, determine if the target is on or off screen.
if it is on screen, put the reticule at object screen x,object screen y like you already have.

if the target is not on screen, you will have to determine whether the target is left, right, up, down, etc from the player, and then put a arrow at the edge of the screen at the X or Y value (depending on which direction the player is from you)
stoned coder
18
Years of Service
User Offline
Joined: 6th May 2007
Location:
Posted: 11th Sep 2007 21:45 Edited at: 11th Sep 2007 21:52
wow, a reply..sorry i havent checked for a month or 2

i want a sprite to lock onto an object so it is positioned in the middle of it, as the object moves the target will move with it, and when the object is off screen the target will point to object direction by moving to the closest possition on screen edges.(so the target is always on screen)
Is that easier to understand that way?
yes i get what u mean....but cant u just do something with the screen x,y command that will make it do what i need?

Login to post a reply

Server time is: 2025-05-15 10:56:04
Your offset time is: 2025-05-15 10:56:04