The summary of ‘sonic game maker studio 2 tutorial – part 1’

This summary of the video was created by an AI. It might contain some inaccuracies.

00:00:0000:22:48

Shakti's video tutorial series aims to teach intermediate users how to create a Sonic-like game using GameMaker Studio 2. He draws on resources like Sonic Retro and graphics from Spirals to establish game mechanics and realistic physics. The tutorial covers creating essential sprites, handling collision detection, and setting up fundamental game objects such as 'obj' and 'obj_under_skull' for managing player interactions and environment collisions.

Key points include defining variables for player movement (e.g., HSP and VSP for speed, ACC for acceleration, and GRAV for gravity) to simulate realistic physics, ensuring speed limits to maintain gameplay balance, and using a script called "key_physics" to manage these parameters. The tutorial also explains movement control through loops and conditional statements to handle player movement, collision detection, and maintaining gameplay fluidity by adjusting speeds and friction appropriately.

The segment outlines implementing fundamental game mechanics, such as gravity affecting vertical speed and using variables for ground detection. Shakti emphasizes efficient code management, like using key bindings for movement control, and discusses advanced player movements like jumping and future plans for 360-degree movement. Overall, the tutorial provides a structured approach to building a Sonic-inspired game, with a focus on realistic physics and fluid player control.

00:00:00

In this part of the video, Shakti introduces a video tutorial series aimed at teaching viewers how to create their own version of a Sonic game using GameMaker Studio 2. The tutorial is designed for those with at least intermediate knowledge of game maker programs. Shakti mentions the resources used, such as Sonic Retro for sonic physics information and some graphics from Spirals. The focus of this specific tutorial is on building the basic ground work for the game. The first steps involve creating two sprites: one for collision detection and another as a stand-in for the main character. Additionally, he instructs on setting up an object group called ‘collision masks’ and creating an object for managing collisions.

00:03:00

In this segment of the video, the creator instructs on creating two new objects named ‘obj’ and ‘obj_under_skull’. The first object relates to playable elements, while the second involves collision detection. They highlight setting the parent attribute for these objects. The segment proceeds to detail the creation of various variables within a ‘create’ event for the playable object. These variables include HSP and VSP for horizontal and vertical speed (both set to zero initially), as well as HSPL and VSPL for their respective speed limits (both set to 16). Additional variables for acceleration (ACC, set to 0.046875), deceleration (DCC, set to 0.05), friction (FRIC, set to 0.0246875), and gravity (GRAV, set to 0.21875) are introduced to simulate realistic movement mechanics for a platforming character akin to Sonic.

00:06:00

In this segment, the creator discusses defining a variable named “ground” to determine if Sonic is on the ground, setting it to false initially. The creation of a script called “key_physics” is described, which will manage Sonic’s interactions with solid objects and his physics behaviors separate from other game scripts. The script includes defining speed limits to prevent Sonic from gaining excessive speed, thereby maintaining game balance. The script checks if the horizontal speed (HSP) or vertical speed (VSP) exceed the set limits and adjusts them accordingly, ensuring Sonic’s speed stays within the defined boundaries. This is done through a series of conditional checks and assignments maintaining terminal velocity, which prevents the player from moving faster than the set limits in both horizontal and vertical directions.

00:09:00

In this part of the video, a programming sequence is described where a statement initializes a variable “I” to zero and checks if it is less than ten. If true, an expression within brackets is executed, followed by incrementing “I” by one. This loop runs until “I” is not less than ten, executing the statements ten times in total.

Additionally, it explains a check for horizontal speed. If speed is greater than zero, a loop runs to move an object one pixel to the right continuously until it collides with a wall. The collision detection works by making a small invisible circle to detect walls and stop movement upon collision.

00:12:00

In this segment of the video, the speaker explains how to implement movement controls for a player character along the vertical axis, allowing the player to move up or down. They describe adjusting the movement script to account for changes in the horizontal speed and how to properly set up vertical movement by modifying variables associated with the Y-axis. Additionally, the speaker emphasizes the importance of using correction scripts to ensure pixel-perfect movement and cautions that incorrect conditional statements can freeze the game. Finally, they discuss adding scripts to handle collisions, ensuring the player moves left if colliding with a wall on the right, and implementing ground detection scripts to keep the player grounded when necessary.

00:15:00

In this part, the video discusses implementing a physics system for a game character. It explains that if the character is falling with zero velocity and the ground is below, the character will snap to the ground, eliminating vertical speed and toggling the ground state to true. This simplifies ground detection using a variable rather than conditional checks. Gravitational force is added to the character’s vertical speed when not on the ground to simulate gravity. The segment ends with setting up key physics code to execute every frame, creating a simple test room, and introducing the next steps for adding player controls using a new script.

00:18:00

In this segment of the video, the speaker explains how to implement efficient key bindings and manage the player’s movement code. By using a shuttle phrase, the code becomes easier to manage and allows for quick changes to key bindings with just one line of code. The movement code checks if the right key is pressed and whether the player’s horizontal speed is greater than or equal to zero. If true, the player’s acceleration is applied; otherwise, the player decelerates to zero before gaining speed in the opposite direction. This logic is repeated for leftward movement by reversing the numbers. The segment also covers decelerating the player when no keys are pressed by subtracting friction. Lastly, if the player’s speed is close to zero, the code ensures it is reduced to zero, ensuring the player does not hover at a minimal speed.

00:21:00

In this part of the video, the speaker explains how to make a player character jump by detaching it from the ground and setting its vertical speed to negative six, allowing the character to move upward until gravity brings it back down. After coding this movement, the speaker adds it to the player’s step event in the game and tests it to ensure the character moves as intended. The segment concludes with a hint about the next video, which will cover 360-degree movement, mimicking Sonic’s well-known loops, along with explanations for understanding the mechanics.

Scroll to Top