https://kunyro.itch.io/platformer50
https://www.youtube.com/watch?v=n35GtJ8CFII
A simple platformer game made using the Godot engine and playable on itch.io. Game was made as a final project for Harvard's CS50 course
- Basic movements using arrowkeys and spacebar
- Variable jump height
- Variable falling speed
- Double jump
- Jump buffer
- Coyote time
- Checkpoints
- Obstacles
(All the code is fully commented btw)
This folder contains all the assets in game and is taken from https://pixelfrog-assets.itch.io/pixel-adventure-1
This folder contains the players Godot scene (player.tscn) and the players script (player.gd).
This code represents a Player class in a 2D game. It extends from CharacterBody2D, which indicates that it is a character with physics properties. It has several constants such as SPEED and JUMP_VELOCITY to define the player's movement speed and jumping behavior.
The gravity variable is synced with the project settings and used to update the player's velocity in the _physics_process() function. The can_double_jump and reached_end variables are used to keep track of the player's ability to double jump and if they have reached the end of the level, respectively.
The animated_sprite variable is assigned to an AnimatedSprite2D node, which is used to display animations for the player. The coyote_timer, jump_buffer_timer, and end_timer variables are used as timers for different mechanics in the game.
The _physics_process() function handles the player's movement and jumping behavior based on user input. It updates the player's velocity and animation state accordingly. It also handles coyote time, which allows the player to jump even if they have left the ground, and jump buffering, which allows for smoother jumping behavior.
The _on_check_point_body_entered() function handles the player reaching a checkpoint and updates the player's spawn position. The _on_saw_body_entered() function handles the player colliding with a saw, which triggers a hit animation and respawns the player at the last checkpoint. The _on_level_end_body_entered() function handles the player reaching the end of the level and starts a timer. If the player stays in the end zone for over 5 seconds, the game ends and the player is taken back to the main menu.
This folder contains everything necessary for the game to run in the browser. It is automatically generated by the Godot engine when exporting the project.
This folder contais the level scene (level_1.tscn) of the game. It also contains the scripts for the scrolling background (level_1.gdshader) as well as the ending point of the game (LevelEnd.gd). Both of these scripts are very simple as they serve mostly as a way to send a signal to the player.
This folder contains the script for the checkpoints of the game (CheckPoint.gd). This script also mostly servers as a signal to send to the player.
This folder contains the scene for the main menu (Menu.tscn) and the script that makes it function (Menu.gd). This is just a button that when clicked on, changes the scene to level1.tscn.
This contains the MP3 files for the music.
This contains the scene for the saws of the game (realSaw.tscn). It also has the script saw.gd which handles the animation of the saws spinning. Ignore saw.tscn it was an old prototype version that isn't used.
Contains a zipped version of the Exported folder. This is used when uploading the game to itch.io.
Default files generated by Godot