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 / simple shooting

Author
Message
awood93
14
Years of Service
User Offline
Joined: 24th Mar 2010
Location:
Posted: 28th Apr 2010 06:31
Can anybody help me? I'm trying to make a really basic FPS game. I can make the projectiles, but what I'm having trouble with is actually shooting them. Can anybody give me some ideas or even some sample code? It doesn't have to be anything fancy, like I said, it's a very simple game. Thanks in advance!
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 28th Apr 2010 14:56
Hi there.
Have a look here.I hope it can help.
http://forum.thegamecreators.com/?m=forum_view&t=169266&b=7

cheers.

I'm not a grumpy grandpa
awood93
14
Years of Service
User Offline
Joined: 24th Mar 2010
Location:
Posted: 28th Apr 2010 19:26
ok, so I just looked at the snippet you posted, and I think I get most of it except for maybe the bala section at the end. Can you tell me if I'm interpreting the coode correctly?

I think this is makeing the variable 'dispara' so that when it's equal to 0, the bullet stays hidden and orients itself so that its facing the same direction as the gun until you click the mouse. Then once the mouse is clicked, the bullet is shown and 'dispara' is now equal to 1. Is this right?

Then in the last part of the bala section:

All I know is that it's saying that after you click the mouse, all this stuff happens, but what is it doing and how is it doing it? This part is where i get really confused.

Also, on a kind of different topic, at the top of the MAIN BUCLE thing it says 'gosub _controla_camara' and 'gosub bala', I understand what these do, but just out of curiosity, are these running simultaneously? Or is it going to the '_controla_camara' section, then going back to the top then going to the 'bala' section?

Login to post a reply

Server time is: 2024-11-23 17:15:43
Your offset time is: 2024-11-23 17:15:43