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.

Newcomers DBPro Corner / Help With Shooting Code

Author
Message
LuNaR
19
Years of Service
User Offline
Joined: 6th Mar 2005
Location:
Posted: 7th Mar 2005 09:21
Hey! I am new to Darkbasic. I did a tutorial and modified it a little. Before I modded it, it was a shoot em up game like when plane was flying to right, and the background was scrolling.

after I modified it I made it scroll down and plane face up like a game called Swarm.

But now I got problems with shooting.

For somereason, when game starts, and i move the plane, and press 'z' to shoot, the laser shoots from where my plane started, and also it only shoots once, if I press z again nothing happens. heres the code



-If Practice makes Perfect, and nobody is perfect, why practice?-
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 7th Mar 2005 10:09
Try something like this.



LuNaR
19
Years of Service
User Offline
Joined: 6th Mar 2005
Location:
Posted: 7th Mar 2005 10:12
Thanks so much!

-If Practice makes Perfect, and nobody is perfect, why practice?-
LuNaR
19
Years of Service
User Offline
Joined: 6th Mar 2005
Location:
Posted: 7th Mar 2005 10:13
If you would be so kind as to describe what you did? It would help me learn! Thanks

-If Practice makes Perfect, and nobody is perfect, why practice?-
Soy Cocktail
20
Years of Service
User Offline
Joined: 23rd Dec 2003
Location:
Posted: 7th Mar 2005 10:27 Edited at: 7th Mar 2005 10:28
If you could post the media I would be glad to help you. I can't code unless I can compile the program. Without the media I can't compile the program. I could create my own media but I dont know the demisions of the original media and you have hardcoded values for adjusting the firing position to the middle of the ship. Oh yeah... and the more important fact that i'm lazy extra work = bad.

The only problem that I can see is that once the lazers position is above 300 it will just stay there untill you shoot again.

edit: oops problem has already been solved.

When life hands you lemons go buy some oranges to make orange juice, and stop expecting everything to be given to you.
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 7th Mar 2005 13:52 Edited at: 7th Mar 2005 13:54
Here is a commented version. I didn't change much. Mainly the moveall gosub.


Login to post a reply

Server time is: 2024-11-13 19:56:01
Your offset time is: 2024-11-13 19:56:01