1. Home
  2. /
  3. Gamemakerstudio
  4. /
  5. GameMaker Studio GML Example - Simple Enemy Follow

GameMaker Studio GML Example - Simple Enemy Follow - Gamemakerstudio Typing CST Test

Loading…

GameMaker Studio GML Example - Simple Enemy Follow — Gamemakerstudio Code

An enemy that follows the player.

// Step Event
var target_x = obj_player.x;
var target_y = obj_player.y;
var speed = 2;
if (x < target_x) { x += speed; }
if (x > target_x) { x -= speed; }
if (y < target_y) { y += speed; }
if (y > target_y) { y -= speed; }

Gamemakerstudio Language Guide

GameMaker Studio (GMS) is a cross-platform 2D and limited 3D game engine developed by YoYo Games, aimed at rapid development of games with a low barrier to entry. It features a visual drag-and-drop interface, scripting via GameMaker Language (GML), and extensive platform export options.

Primary Use Cases

  • ▸2D indie games for PC, mobile, and consoles
  • ▸Rapid prototypes and game jams
  • ▸Educational games and interactive media
  • ▸Casual and arcade games
  • ▸Platformers, RPGs, shooters, and puzzle games

Notable Features

  • ▸Drag-and-drop visual programming interface
  • ▸GameMaker Language (GML) scripting
  • ▸Built-in physics engine
  • ▸Cross-platform export (Windows, macOS, Android, iOS, HTML5, consoles)
  • ▸Sprite, animation, and tilemap tools

Origin & Creator

Originally created by Mark Overmars in 1999 as Animo, later renamed Game Maker, it evolved into GameMaker Studio under YoYo Games in 2011 with modern features and cross-platform support.

Industrial Note

GameMaker Studio is popular in the indie game industry, especially for 2D games, prototypes, mobile apps, and rapid development projects with limited team sizes.

More Gamemakerstudio Typing Exercises

GameMaker Studio GML Example - Simple Player MovementGameMaker Studio GML Example - Player JumpGameMaker Studio GML Example - Simple ShootingGameMaker Studio GML Example - Collision DetectionGameMaker Studio GML Example - Score CounterGameMaker Studio GML Example - Simple GravityGameMaker Studio GML Example - Platform CollisionGameMaker Studio GML Example - Simple Enemy PatrolGameMaker Studio GML Example - Simple Animation

Practice Other Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypher