Making 2d shooter... i know been there done that.

Started by zerocell, Thu 13/12/2007 06:47:56

Previous topic - Next topic

zerocell

So, heres the thing...

I used the magic search button, to try to find out HOW to make a 2d sidescrolling shooting game. I know, alot of people have asked the same question over and over again "is it possible, can it be done, bla bla bla", but my deal is, HOW?! I'm completely new to writing code and source, so any help, or like a point in the right direction would be greatly appreciated. Thanks in advance! ;D

Gilbert

The problem is, as the name implies, AGS is not prelimary designed for these kind of games, so you should expect that it's no easy task to make this kind of games (depends also on how you want the game to be like, but we don't have any idea in mind about how complicated it should be as you didn't provide the information). I think not many people had made these kind of games with AGS (probably none, but that doesn't mean it is impossible) so there wouldn't be many examples that you can follow.

My advice is, start simple, try to toy around with the package first, maybe make some testing adventure games with it. Also, if you really like to make a shooting game you may also check out other game creation packages that're more aimed at these kind of games.

zerocell

well you see, i've toyed around alot with making the graphical PnC games... and that works out alright, i mean, its pretty simple stuff to work with... Scripting knowledge or not. What I wanted to do was try to implement a sidescrolling shooter WITHIN a point and click.... have the lucas style adventure game at certain points, and a metal slug style shooter at other points... but for THAT, i assume i'd need some scripting knowledge of some sort... I played the platformious(sp?) and i like how it was done. I'm just sketchy on how to use the code. thats about it.... thats the catch, and the general idea. thanks for your help.

Khris

#3
I'd use a separate room for every shooter level. All shooter related code goes into a module.

To get a side-scrolling effect, I'd use 320x50 objects at the top and bottom of the screen.
E.g. at the top, the first object starts at 0:50, the second one at 320:50. Both are moved left until the first one reaches -320:50, at this time a new (random/pre-set) graphic is loaded and the object's position is reset to 320:50.
Same at the bottom.

Rep_ex code in the module for moving everything, an AddEnemy function and one for fired shots, one for collision detection, maybe a power-up function, too.

These are all just pointers. Writing a side-scrolling shooter is definitely possible but a huge undertaking and no easy task even for advanced scripters.

zerocell

hm... sounds complicated... Shouldnt be that big of a deal. I've got alot of free time, and im up to learning anything. Good advice though, I sort of understood most of that. lol ;D... I'm sure it should turn out alright.


umm what exactly does all this mean, and where would i find information on how to do this???
Quote from: KhrisMUC on Fri 14/12/2007 05:34:13
To get a side-scrolling effect, I'd use 320x50 objects at the top and bottom of the screen.
E.g. at the top, the first object starts at 0:50, the second one at 320:50. Both are moved left until the first one reaches -320:50, at this time a new (random/pre-set) graphic is loaded and the object's position is reset to 320:50.
Same at the bottom.

Rep_ex code in the module for moving everything, an AddEnemy function and one for fired shots, one for collision detection, maybe a power-up function, too.

Khris

320:50 are coordinates. X-coordinate is 320, y-coordinate is 50.

If none of that made sense to you, ditch coding a side-scroller for now. Learn to use the engine first.

(And please, get rid of that really annoying signature animation. It literally hurts my eyes.)

zerocell

Lol, yeah, it bothers me too. I'll get rid of it. Umm, I understood the coordinates bit, but I didnt really catch on to this:
"Rep_ex code in the module for moving everything, an AddEnemy function and one for fired shots, one for collision detection, maybe a power-up function, too."

Thats where i have trouble, i dont understand how to WRITE the code for it... which was the reason I wanted maybe an example of something to follow and guide me...

Khris

In the module script, add a function:
Code: ags
function repeatedly_execute() {
  level_movement();
  player_movement();
  enemy_movement();
  if (collision_detection()) handle_collision();
}

Now put the functions above that.

That's all. The function is called automatically once every frame, by default 40 times per second.

player_movement could look like this:
Code: ags
function player_movement() {
  if (IsKeyPressed(380)) { // cursor down
    if (player.y<200) player.y+=2;
  }
  ...
}

SMF spam blocked by CleanTalk