• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Scrolling shooter tutorial using Drag and Drop

GM Version: GMS2
Target Platform: ALL
Download: see video below
Links: sprite sheet: https://www.widgetworx.com/spritelib/ 📌Updated 21 Oct 2020
(Sprite sheet created by Ari Feldman is available for free use under terms of Common Public License Ver1.0)

Summary:
The aim of this beginners tutorial is to complete a simple scrolling shooter using purely Drag and Drop.
It starts with an idea and a sprite sheet.
With some imagination, it can be adapted to suit various other types of scrolling shooters.
Tips on shortcuts are included for speed and efficiency.


Tutorial:
Part 1 shows how to extract sprites from a sprite sheet using the sprite editor, make objects and use the room editor to make a top down scrolling room.

Part 2 shows setting up movement and shooting controls and how to correct diagonal speed.

Part 3 shows how to create the enemies using parent & child method, explosions, setup Heads Up Display with score, health, lives and cross-reference variables between instances.

Part 4 shows how a child object can have its own behavior and inherit its parent's events, create font, draw built-in and custom info on Heads Up Display.

Part 5 shows how to make different enemies shoot different bullets randomly and to compensate play area due to HUD position.

Notes:
Below is a minimal game design document to outline steps in making this game. It introduces the importance of planning before coding and serves as a road-map when fleshing out the game.


Set room speed to 60.

Create all sprites.
- Water .. will not be an object, for background use
- islands qty 3
- player plane
- player bullet
- enemy planes green, orange, white
- explosions qty 2
- enemy bullet
- Heads Up Display (HUD)
- player spawn
- repair (extra health)
- ammo (power up)
- player bullet2

Create all empty objects using sprites.
Create scrolling background,
Build 3 island objects and place in room.....TEST

Create layer for player.
Build player object ..... TEST
- 4 direction control with corrected diagonal speed
- var mag
- step .. ck movement and assign mag
- Z key .. create a bullet

Build player bullet.
- set speed, destroy when not needed
goto PLAYER object
- bullet firing-rate ie var canShoot

Build explosion (small and big)
- animation end .. destroy itself
- small explosion .. set speed on condition

Create layer for enemy planes.
Build enemy objects. build one, duplicate and change sprite
- create .. speed, direction
- end step .. bottom of room?

Create layer for HUD.
Create controller object to spawn HUD. Place ctrl in room.
Build HUD.
- create .. set health, score, lives, kills
- draw .. self, instance health, lives icon, instance score, kills
- step .. ck health < 0
create big explosion at player plane
ck lives > 0
set health to 100
set lives to -1 rel
else
exit game

- goto ENEMY objects
- collision with player bullet (for all enemy planes)
- call paarent event .... TEST


Build enemy bullet x2 (normal and smart)
- create .. dir speed
- outside room .. destroy

goto PLAYER object
- coll with enemy ..
- ck sprite index
- explosion, health, score, jump to bottom TEST ENEMY GREEN
-coll with enemy bullet x2
- ck sprite index
- explosion, health, destroy bullet


Ammo object coll w player??

Repair object coll w player??

The decision to create rewards will be done in the HUD object
- goto HUD object
- step
- ck kills
- ck health
- ck instance exists
- create repair

Assign var bullet2 to Player object
- ck id white enemy exists
- get count
- ck count > 1
- ck if bullet2 is not active
- ck if Ammo NOT exist
- create Ammo

Audio for explosion qty 2
 
Last edited:
  • Like
Reactions: Rob
Continuation of this tutorial series ....

Part 6 shows how to make rewards (extra health and ammunition).

Part 7 shows how to spawn enemies, award rewards and add audio.

Part 7 extra, includes items missed out in part 7.
It shows spawning of another enemy, increased firepower on power-up.
.... the end.
 
Last edited:
Top