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! / need help with side scroller game

Author
Message
gamer2021
20
Years of Service
User Offline
Joined: 4th May 2003
Location:
Posted: 5th May 2003 15:38
I'm trying to create an bullet that goes on an straight line from
the sprite which shot the bullet.Can someone tell me how can i do this.Btw here is the source.
Flashing Blade
21
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 6th May 2003 11:25
This bit:

if upkey()=1 then shipy=shipy-4
if downkey()=1 then shipy=shipy+4
if leftkey()=1 then shipx=shipx-4
if rightkey()=1 then shipx=shipx+4

sprite 1,shipx,shipy,1

is fine.


This bit:

if mouseclick()=1
move=shipx
sprite 3,move,move1,3

endif

is not fine.


I assume from your source that you wanna move ship with cursors and fire a bullit with a mouse click.


Try this -> (source code)

done in DBP
gamer2021
20
Years of Service
User Offline
Joined: 4th May 2003
Location:
Posted: 6th May 2003 20:35
Thanks Flashingblade.

Login to post a reply

Server time is: 2024-04-19 07:30:30
Your offset time is: 2024-04-19 07:30:30