Gamestudio Links
Zorro Links
Newest Posts
Z9 getting Error 058
by k_ivan. 04/25/26 19:13
ZorroGPT
by TipmyPip. 04/25/26 16:09
Stooq now requires an API key
by jcl. 04/13/26 09:42
Strange "Alien" Skull created with >Knubber<
by NeoDumont. 04/10/26 18:58
400 free seamless texture pack downl. here !
by NeoDumont. 04/08/26 19:55
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (kiamonster, 1 invisible), 3,518 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
valino, juergenwue, VladMak, Geir, ondrej
19209 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 | 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