Nubzuki Jump
- Name: Tomas Horsky
- ID: 20256426
- Email: tomashorsky@kaist.ac.kr
- Git Repository: https://git.prototyping.id/20256426/NubzukiJump
- Demo Video:
How to use
npm install
npm run dev
Description of the game
Nubzuki Jump is a simple 2D platformer game where the player controls a character named Nubzuki. The goal is to jump on platforms and reach as high as possible without falling down. The game features four different types of platforms, which are introduced as the player progresses, the types of platforms are:
- Basic platform
- Moving platform – a platform that moves horizontally
- Spring platform – boosts the player's jump
- One-time platform – disappears after one jump
The player can move only left and right, the jumping is done automatically whenever player lands on platform. Game is controlled either by using the arrow keys, or by enabling camera control and moving head left or right.
Code Organization
The code is divided into two main parts, the Svelte app and the game logic inside of src/game. The Svelte app is responsible for layout of the page, displaying the leaderboard and handling the game state (start, end, restart). It also contains one component CameraControl.svelte which is responsible for enabling camera control and showing reading of head movement.
The game logic is divided into several files:
game.js- the main file which initializes the game and handles the game loopplayer.js- contains the logic related to the player character, such as movement and player stateplatforms.js- contains logic for creating and managing platformsplatformTypes.js- handles the creation and behavior of of platforms by typecameraControl.js- contains the logic for enabling camera control and reading head movementconstants.js- contains constants for the game
How that different parts of the code are conected and are communicating can be seen in the following diagram:
Issues
The issue I was not able to solve is that when using camera control, the game becomes slower and a little bit laggy. I improved it by lowering the camera resolution and reducing the detection frequency, however its still not perfect but playeble. Other then that, the colisons between player and edges of platform are not always perfect, but nothing terrible.
Resources and Acknowledgements
- P5play tutorial and P5play documentation - to help me with p5play
- Github copilot - to help me write code faster
- ChatGPT - mainly for camera controls and for finding bugs in my code
