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! / 90 degree shot, not what i want

Author
Message
Fa1con
17
Years of Service
User Offline
Joined: 20th Aug 2007
Location:
Posted: 30th Oct 2007 04:31
hey i was just wodnering im making a program for just a simple game kinda like paratrooper but a bit different, so i have the cannon rotating where iw ant it to,


but for some reason my shooting code,


for some reason the bullet always shoots 90 degrees from the way it is facingso if the cannon is poiting straight up it will shoot straight left, anyone have any ideas, im thinking that my cannon picutre is sideways so i could rotate it and save the picture a different way so it would work? would that do the trick, thanks,
Fa1con
17
Years of Service
User Offline
Joined: 20th Aug 2007
Location:
Posted: 30th Oct 2007 04:40
and i also have another question


can anyone run this program and look at my code i have spent so long trying to figure out why the ball shoots out from the side of the screen and i am clueless

Attachments

Login to view attachments
BiggAdd
Retired Moderator
20
Years of Service
User Offline
Joined: 6th Aug 2004
Location: != null
Posted: 30th Oct 2007 16:44
Take a look at an example I made a while ago. It may not be perfect, but its a good start:
Link

The move sprite command will move a sprite Upwards (with a rotation of 0), meaning your bullet image should face "upwards". If your bullets are always coming out at 90 degrees to your ship, then simply add or subtract 90 to the bullet rotation. Simple as.

Hope this helps.


Its finally here!
Fa1con
17
Years of Service
User Offline
Joined: 20th Aug 2007
Location:
Posted: 31st Oct 2007 01:04
ohhh thank you so much it does exactly right, thank you soo much

Login to post a reply

Server time is: 2025-05-14 04:05:40
Your offset time is: 2025-05-14 04:05:40