-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
51e09e0
commit b9b5da6
Showing
20 changed files
with
1,450 additions
and
864 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,204 @@ | ||
//Player 1 | ||
const player1 = { | ||
// Coordinates | ||
x : 0, | ||
y : 500, | ||
height : 40, | ||
width : 30, | ||
// Frames | ||
currentFrameStand : 0, | ||
currentFramePunch : 0, | ||
currentFrameRun : 0, | ||
currentFrameCrouch : 0, | ||
// Help punch variables | ||
punched : false, | ||
punchCooldown : false, | ||
alreadyPunched : false, | ||
// Velocity | ||
velocity : 0, | ||
velocityJump : 0, | ||
velocityRight : 0, | ||
velocityLeft : 0, | ||
velocityGoingDown : 0, | ||
velocityGoingUp : 0, | ||
// Help move variables | ||
isMovingRight : false, | ||
isMovingLeft : false, | ||
// Animation | ||
turnedRight : true, | ||
turnedLeft : false, | ||
animationIdRight : null, | ||
animationIdLeft : null, | ||
ahCollision : null, | ||
underCollision : null, | ||
jumpingId : null, | ||
goingUpId : null, | ||
goingDownId : null, | ||
// NOW THEN DELTA | ||
nowLeft : null, | ||
thenLeft : Date.now(), | ||
deltaLeft : null, | ||
// | ||
nowRight : null, | ||
thenRight : Date.now(), | ||
deltaRight : null, | ||
// | ||
nowDown : null, | ||
thenDown : Date.now(), | ||
deltaDown : null, | ||
// | ||
nowUp : null, | ||
thenUp : Date.now(), | ||
deltaUp : null, | ||
// | ||
nowGoingUp : null, | ||
thenGoingUp : Date.now(), | ||
deltaGoingUp : null, | ||
// | ||
nowGoingDown : null, | ||
thenGoingDown : Date.now(), | ||
deltaGoingDown : null, | ||
// Help Jump variables | ||
stillJumping : false, | ||
// Help Crouch variables | ||
crouched : false, | ||
downPressed : false, | ||
canStandUp : true, | ||
wasUnder : true, | ||
// Gravity | ||
onRock : false, | ||
onWood : false, | ||
orbUsed : false, | ||
canOrbJump : false, | ||
gravityId : null, | ||
// Ladder | ||
ladderCol : false, | ||
canGravityActivate : false, | ||
alreadyGoingDown : false, | ||
wPressed : false, | ||
// Jump | ||
headHit : null, | ||
bounced : false, | ||
jumpInterval : null, | ||
jumpIntervalSet : false, | ||
isJumping : null, | ||
canUseJumpPad : false, | ||
// Doors | ||
doorCol : false, | ||
closingDoorCol : false, | ||
// Boss | ||
canAttack : false, | ||
//Slide | ||
canSlideOnWall : false, | ||
slideJumped : false, | ||
//Moving platform | ||
onMovingPlatform : false, | ||
} | ||
|
||
//Player 2 | ||
const player2 = { | ||
// Coordinates | ||
x : 0, | ||
y : 500, | ||
height : 40, | ||
width : 30, | ||
// Frames | ||
currentFrameStand : 0, | ||
currentFramePunch : 0, | ||
currentFrameRun : 0, | ||
currentFrameCrouch : 0, | ||
// Help punch variables | ||
punched : false, | ||
punchCooldown : false, | ||
alreadyPunched : false, | ||
// Velocity | ||
velocity : 0, | ||
velocityJump : 0, | ||
velocityRight : 0, | ||
velocityLeft : 0, | ||
velocityGoingDown : 0, | ||
velocityGoingUp : 0, | ||
// Help move variables | ||
isMovingRight : false, | ||
isMovingLeft : false, | ||
// Animation | ||
turnedRight : true, | ||
turnedLeft : false, | ||
animationIdRight : null, | ||
animationIdLeft : null, | ||
ahCollision : null, | ||
underCollision : null, | ||
jumpingId : null, | ||
goingUpId : null, | ||
goingDownId : null, | ||
// NOW THEN DELTA | ||
nowLeft : null, | ||
thenLeft : Date.now(), | ||
deltaLeft : null, | ||
// | ||
nowRight : null, | ||
thenRight : Date.now(), | ||
deltaRight : null, | ||
// | ||
nowDown : null, | ||
thenDown : Date.now(), | ||
deltaDown : null, | ||
// | ||
nowUp : null, | ||
thenUp : Date.now(), | ||
deltaUp : null, | ||
// | ||
nowGoingUp : null, | ||
thenGoingUp : Date.now(), | ||
deltaGoingUp : null, | ||
// | ||
nowGoingDown : null, | ||
thenGoingDown : Date.now(), | ||
deltaGoingDown : null, | ||
// Help Jump variables | ||
stillJumping : false, | ||
// Help Crouch variables | ||
crouched : false, | ||
downPressed : false, | ||
canStandUp : true, | ||
wasUnder : true, | ||
// Gravity | ||
onRock : false, | ||
onWood : false, | ||
orbUsed : false, | ||
canOrbJump : false, | ||
gravityId : null, | ||
// Ladder | ||
ladderCol : false, | ||
canGravityActivate : false, | ||
alreadyGoingDown : false, | ||
wPressed : false, | ||
// Jump | ||
headHit : null, | ||
bounced : false, | ||
jumpInterval : null, | ||
jumpIntervalSet : false, | ||
isJumping : null, | ||
canUseJumpPad : false, | ||
// Doors | ||
doorCol : false, | ||
closingDoorCol : false, | ||
// Boss | ||
canAttack : false, | ||
//Slide | ||
canSlideOnWall : false, | ||
slideJumped : false, | ||
//Moving platform | ||
onMovingPlatform : false, | ||
} | ||
|
||
let playingMultiplayer = false; | ||
|
||
//This will spawn you | ||
let spawnCords = () => { | ||
player1.x = 35; | ||
player1.y = 500; | ||
player2.x = 70; | ||
player2.y = 500; | ||
} | ||
spawnCords(); |
Oops, something went wrong.