Skip to content

Simple Platformer Game in JavaScript #67

@HARSH-1607

Description

@HARSH-1607

Game Name: Simple Platformer

Description:

Overview: A classic 2D platformer game built with a single HTML file using vanilla JavaScript and the element. The player controls a character who can move and jump to navigate a fixed level composed of platforms. The objective is to guide the character from a starting point to a designated exit, testing the player's timing and coordination.

Key Features:

Player Controls:

Smooth left and right movement using the ArrowLeft and ArrowRight keys.

Jumping mechanic initiated with the Spacebar or ArrowUp key.

Basic physics simulation, including gravity that pulls the player down and momentum for movement.

Level Layout:

The game world (player, platforms, goal) will be rendered on an HTML .

The level will consist of several static, rectangular platforms at different heights and positions.

A clear start position and an exit point (e.g., a differently colored block or flag).

Game Mechanics:

A core game loop using requestAnimationFrame for smooth animation and consistent updates.

Collision detection to allow the player to stand and land on top of platforms, and to prevent them from moving through platforms from the sides or bottom.

A win condition that is triggered when the player character reaches the exit.

User Interface:

An on-screen message (e.g., "You Win!") appears upon completing the level.

A "Reset" button to allow the player to restart the level at any time.

Optional Enhancements (for future contributions):

Multiple levels with increasing difficulty.

Moving platforms or simple hazards to avoid.

Collectible items (like coins) that must be gathered to finish the level.

A timer to track the player's completion speed.

Preferred Language: Javascript

Additional Details:

Deliverables: A new folder created at: Game_Scripts/Javascript/Platformer/ containing:

index.html (The main file with HTML structure).

style.css (For basic styling of the page and canvas).

script.js (Containing all game logic).

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions