Skip to content

Commit

Permalink
Merge pull request #3 from deanblackborough/dash
Browse files Browse the repository at this point in the history
Dash
  • Loading branch information
deanblackborough authored Aug 3, 2024
2 parents e561b83 + 80af7b2 commit 71ab577
Show file tree
Hide file tree
Showing 31 changed files with 177 additions and 8 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@ Check the playerInput script file, the controls should be what you expect though

## Features

- Player moment - left, right, jump
- Player moment - left, right, jump & dash
- Gravity setting and terminal velocity setting
- Max jumps setting
- Moving jump through platforms, move in x and/or y
- Player collision with ground
- Player collision with jump through platforms
- Player collision with moving jump through platforms
- Players can drop through jump through platforms with down + jump
- Players can drop through moving jump through platforms with down + jump
- Player sprites for idle, running and jumping
- Player can drop through jump through platforms with down + jump
- Player can drop through moving jump through platforms with down + jump
- Player single dash (gravity disabled during dash)
- Player sprites for idle, running, jumping & dashing

## Working on

- Super dash
- Dashing
- Slide
- Rolling
- Landing after fall
- Wall climb & Wall hang
- Breakable walls/platforms
- Ladders
Expand Down
1 change: 1 addition & 0 deletions gm-platformer.yyp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions objects/oPlayer/Create_0.gml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@

playerMovementSpeed = 2;
playerMovementSpeedDash = 6;
playerMovementDirection = 1;

playerDashTimer = 0;
playerDashTimerMax = 15;

playerSpeedX = 0;
playerSpeedY = 0;

playerSprite = sPlayerIdle;
playerSpriteIdle = sPlayerIdle;
playerSpriteRun = sPlayerRun;
playerSpriteDash = sPlayerDash;
playerSpriteJump = sPlayerJump;
playerSpriteFacing = 1;

Expand Down
26 changes: 25 additions & 1 deletion objects/oPlayer/Step_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@ if (playerMovementDirection != 0)

playerSpeedX = playerMovementDirection * playerMovementSpeed;

if (abs(playerSpeedX) > 0 && inputShiftKey) {

playerDashTimer++;

if (playerDashTimer < playerDashTimerMax)
{
playerSpeedX = playerMovementDirection * playerMovementSpeedDash;
}
}

if (!inputShiftKey)
{
playerDashTimer = 0;
}

if (place_meeting(x + playerSpeedX, y, oGround))
{
if (snapToColliders)
Expand All @@ -29,7 +44,10 @@ if (place_meeting(x + playerSpeedX, y, oGround))


/** Player movment Y **/
playerSpeedY += gravitySpeed;
if (abs(playerSpeedX) < playerMovementSpeedDash)
{
playerSpeedY += gravitySpeed;
}

// If player is on the ground and reset the jumps
if (playerOnGround)
Expand Down Expand Up @@ -178,12 +196,18 @@ if (abs(playerSpeedX) > 0)
sprite_index = playerSpriteRun;
}

if (abs(playerSpeedX) > playerMovementSpeed)
{
sprite_index = playerSpriteDash;
}

if (abs(playerSpeedY) > 0 && playerOnGround != true)
{
sprite_index = playerSpriteJump;
}



/*****************************************
**
** Debug messages
Expand Down
2 changes: 1 addition & 1 deletion rooms/room01/room01.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions scripts/playerInput/playerInput.gml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ function getPlayerInput()
gamepad_button_check(0, gp_padd);

inputDownKey = clamp(inputDownKey, 0, 1);

inputShiftKey = keyboard_check(vk_shift) +
gamepad_button_check(0, gp_face2);

inputShiftKey = clamp(inputShiftKey, 0, 1);

inputJumpKeyPressed = keyboard_check_pressed(vk_space) +
gamepad_button_check_pressed(0, gp_face1);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
134 changes: 134 additions & 0 deletions sprites/sPlayerDash/sPlayerDash.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 71ab577

Please sign in to comment.