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! / Shooting at cursor

Author
Message
AJay
22
Years of Service
User Offline
Joined: 24th Jan 2004
Location:
Posted: 22nd Jun 2005 10:45
The game I'm working on has a small character at the bottom who can run left and right accross the screen. When you move the mouse to the left or right of him he looks that way, same if you movie it above him. What I am wanting to do now is get him to shoot at the position the cursor is at when I press the right mouse button. I already know how to shoot straight ahead (just creat the bullet and move it forward a bit every loop). I just can't seem how to get it to figure out the angle it needs to shoot at.

Thanks guys

128MB ATI All In Wonder 9200 AGP video card, 768 MB of Ram, 2.4 Ghz Pentium 4 processor, 768 MB of ram, 64 bit sound blaster live, 40 Gig hard drive. -AJay- Much thanks to Coding Area

AJay
22
Years of Service
User Offline
Joined: 24th Jan 2004
Location:
Posted: 22nd Jun 2005 15:13
Anyone???

128MB ATI All In Wonder 9200 AGP video card, 768 MB of Ram, 2.4 Ghz Pentium 4 processor, 768 MB of ram, 64 bit sound blaster live, 40 Gig hard drive. -AJay- Much thanks to Coding Area

pizzaman
22
Years of Service
User Offline
Joined: 18th Feb 2004
Location: Gateshead, UK
Posted: 23rd Jun 2005 00:37 Edited at: 23rd Jun 2005 00:37
I made this a few weeks back to show someone how to get an enemy fire in any direction.



Note: The code will work with both DBC and DBP

Login to post a reply

Server time is: 2026-06-12 11:21:59
Your offset time is: 2026-06-12 11:21:59