Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
2 registered members (Quad, AndrewAMD), 1,007 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
How-to do shot elements in 2d game #336283
08/02/10 20:01
08/02/10 20:01
Joined: Aug 2010
Posts: 5
G
Germanno Offline OP
Newbie
Germanno  Offline OP
Newbie
G

Joined: Aug 2010
Posts: 5
Good night

I'm new in game programming, so I have some questions.

I'm doing a shooter game, like Gradius, a 2d game with side scrolling.

I have my ship controls working fine, but now the problem is: How can I make a shot (a bullet, for example) starts to navigate across screen when I activate "space" key on keyboard?

I know how to make something to move based on a specific key, but I cant figure how to make this key trigger an event as a bullet, and in what I could base this bullet to navigate in screen.

Sorry for my low quality English, I'm from Brazil, so English is a foreign language for me.

Thanks in advance.

Re: How-to do shot elements in 2d game [Re: Germanno] #336366
08/03/10 13:10
08/03/10 13:10
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
on_space or key_space helps here, example in the manual.

Re: How-to do shot elements in 2d game [Re: Widi] #336419
08/03/10 18:46
08/03/10 18:46
Joined: Aug 2010
Posts: 5
G
Germanno Offline OP
Newbie
Germanno  Offline OP
Newbie
G

Joined: Aug 2010
Posts: 5
Thanks for reply mate

I was walking in the wrong path...trying to use ent_create and c_move to move the bullets. Guess isnt the best choice for 2D games.

Now i'm using a "PANEL* bullets[100]" pointer, so I can control bullets independently at every cicle.

I'm using also a "loop()" function, that will call functions to update ship position, bullets position, and all other things.

If someone, someday, have similar doubts in 2D games, I can indicate AUM, especially editions 81 ~ 85 who had helped me a lot.

The cool part of Lite-C is that it's fast to learn how to use the main features.

Best regards


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1