[GML] Basic Player Shooting – Loose Java basicplayer shooting script

[Basic Player Mechanic] GameMaker:Studio GML Basic Player Shooting tutorial. Learn to make your player shoot a bullet in this game development community.

GML Basic Player Shooting

gml basic player shooting - loose java basicplayer shooting scriptThis is a simple GML Basic Player Shooting snippet for a loose java basicplayer shooting mechanic. This is a great recipe to try after just completing our GML Asteroids Style Movement tutorial.


  • Game Maker 8.1 Or Game Maker: Studio

Game Objects:

  • ObjPlayer
  • ObjBullet

Setting Up ObjPlayer:

The Player Create Event


The Player Step Event


The Player Alarm Event


Setting up ObjBullet

The Bullet Create Event


The Bullet Collision Event


Kyle on sabyoutubeKyle on sabwordpressKyle on sabtwitterKyle on sablinkedinKyle on sabfacebookKyle on sabemail
Hi there, I'm Kyle. I'm a web developer and an indie game developer. Currently working on an android game called: Burning Rush developed in Game Maker: Studio and is currently in Early Access Stages.

I enjoy working with code, favorite language currently: Python.
Currently working: Freelance Part-time, Real Estate Marketing & Web Development Full-time, and Indie Game Development with Unholy Squid Entertainment.

You might also like


  1. Pingback: [GML] Asteroids Style Movement - Styxnyx

  2. Hello, I used this code but if I held down the mouse button, it would not keep shooting (only one shot every time I click)
    Any tip for that?

      1. Profile photo of Kyle

        Hey I’m so sorry for the late reply. So my code above uses the space bar but you are using the mouse button to shot. I’m guessing your code has something like: mouse_check_button_pressed(mb_left)? Try with mouse_check_button(mb_left) I believe. I can’t remember it’s been a while, but one is only going to trigger the moment it’s pressed, whereas one is going to trigger anytime it’s true.

Leave a Reply

Your email address will not be published. Required fields are marked *