Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/game logic #1

Open
wants to merge 69 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
b5c1807
Added basic assets
angarita-dev Jul 21, 2020
5d4629c
Added resources, player movement & basic platforms
angarita-dev Jul 21, 2020
78cd1c6
Platform generation & reuse logic
angarita-dev Jul 22, 2020
e0361e3
Added moving platforms
angarita-dev Jul 23, 2020
521b56f
Moved platform generation logic to its class
angarita-dev Jul 23, 2020
2ff5af1
Modified platform generation parameters
angarita-dev Jul 23, 2020
c71faa5
Refactored game to be a scene
angarita-dev Jul 23, 2020
c69673b
Added death scene
angarita-dev Jul 23, 2020
b19d940
Changed moving platform file name
angarita-dev Jul 24, 2020
0265a20
Changed physics of platforms & modified platform y
angarita-dev Jul 24, 2020
4220893
Added item logic
angarita-dev Jul 24, 2020
9868d11
Passed score to death scene
angarita-dev Jul 24, 2020
604f657
Added item recollection display
angarita-dev Jul 24, 2020
84d182b
Added resources to webpack & changed preload method
angarita-dev Jul 24, 2020
7684dd9
Changed locations & scale method
angarita-dev Jul 27, 2020
5638800
Fixed game jump
angarita-dev Jul 27, 2020
601aa54
Added increased difficulty & fixed movement
angarita-dev Jul 27, 2020
9c4f3c6
Added platfrom manager & simplified platform manipulation logic
angarita-dev Jul 27, 2020
c551f01
Reduced difficulty
angarita-dev Jul 27, 2020
2fcc69a
Removed unused package
angarita-dev Jul 27, 2020
b80e11f
Reduced difficulty again & ignored dev file
angarita-dev Jul 27, 2020
c370b01
Changed resize method
angarita-dev Jul 27, 2020
3b74556
Changed resize method
angarita-dev Jul 27, 2020
182e444
Merge branch 'feature/game-logic' of github.com:codingAngarita/anothe…
angarita-dev Jul 27, 2020
bd6d202
Changed star spawn probability & resize
angarita-dev Jul 27, 2020
f83f523
Changed webpack to handle sass files
angarita-dev Jul 29, 2020
4e00044
Added background scenes
angarita-dev Jul 30, 2020
fb438bd
Fixed indent
angarita-dev Jul 30, 2020
89131bb
Added title scene
angarita-dev Jul 30, 2020
05fe9cb
Added moving clouds
angarita-dev Jul 31, 2020
2503e50
Added background mountains & moved title text accordingly
angarita-dev Jul 31, 2020
9a9cd1e
Added background scrolling & death handle
angarita-dev Jul 31, 2020
79cf612
Added transitions for title scene
angarita-dev Jul 31, 2020
a0c8b66
Added character selection and added replay functionality
angarita-dev Jul 31, 2020
96cda3b
Fixed back mountains tiling problem
angarita-dev Aug 1, 2020
9a18d88
Added utils scene and moved repeted logic
angarita-dev Aug 1, 2020
a92090a
Fixed fade duration bug
angarita-dev Aug 1, 2020
1b4916b
Added falling animation
angarita-dev Aug 1, 2020
f044e30
Modified death fades
angarita-dev Aug 1, 2020
cf5bf5e
Added character & collectible custom sprites
angarita-dev Aug 2, 2020
1109dd5
Added random platforms
angarita-dev Aug 2, 2020
867ad5f
Removed unused assets
angarita-dev Aug 2, 2020
d413de2
Added missing package
angarita-dev Aug 2, 2020
59870cc
Added missing package
angarita-dev Aug 2, 2020
cc99834
Merge branch 'feature/game-logic' of github.com:codingAngarita/anothe…
angarita-dev Aug 2, 2020
cb0ebf9
Update game.js
angarita-dev Aug 2, 2020
42ad790
Added functionalities & solved duration bug
angarita-dev Aug 2, 2020
226fc07
Added credits scene
angarita-dev Aug 2, 2020
167243d
Added early scoreboard
angarita-dev Aug 2, 2020
199b48e
Stoping credits scene
angarita-dev Aug 2, 2020
e4f9c5e
Merge branch 'feature/game-logic' of github.com:codingAngarita/anothe…
angarita-dev Aug 2, 2020
84c1e4c
Added dotenv to webpack
angarita-dev Aug 3, 2020
a4308f1
Added support for Async JS in Babel
angarita-dev Aug 3, 2020
f6ebd2c
Changed assets
angarita-dev Aug 3, 2020
26a8f0a
Added change in color of score when sky gets dark
angarita-dev Aug 3, 2020
250b595
Added scoreboard
angarita-dev Aug 4, 2020
1fdbc23
Modified dotenv-webpack config
angarita-dev Aug 4, 2020
9bec0e5
Removed unused stylesheet import
angarita-dev Aug 4, 2020
aaca1c5
Fixed bug where counter didnt change color on black sky
angarita-dev Aug 4, 2020
69fa801
Added config for tests
angarita-dev Aug 4, 2020
992dd0e
Added tests and added command description in the README
angarita-dev Aug 6, 2020
6578381
fixed linter errors and added command to README
angarita-dev Aug 6, 2020
f40ed65
Updated readme with assets info & status badge
angarita-dev Aug 6, 2020
b7cac5a
Added live version
angarita-dev Aug 6, 2020
1d2634a
Added style linter
angarita-dev Aug 6, 2020
5fa306d
Added info about local setup, API & how to play
angarita-dev Aug 9, 2020
6e8866d
Added title art image to readme
angarita-dev Aug 9, 2020
d5d6ad0
Added additional info & changed live version style
angarita-dev Aug 11, 2020
ccbaba6
Fixed broken badge
angarita-dev Aug 11, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed game jump
  • Loading branch information
angarita-dev committed Jul 27, 2020
commit 5638800b3e98e6f1c71c645aabeabf923c99afd4
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const config = {
physics: {
default: 'arcade',
arcade: {
gravity: { y: 450 },
gravity: { y: 450 }
},
},
scene: [
Expand Down
2 changes: 1 addition & 1 deletion src/movingPlatform.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default class MovingPlatform extends Phaser.Physics.Arcade.Image {
this.runningTween = this.scene.tweens.addCounter({
from: 0,
to: 1000,
duration: 9000,
duration: 14000,
onUpdate: (tween, target) => {
const { scrollY } = this.scene.cameras.main;
const y = this.startY + target.value + scrollY;
Expand Down
10 changes: 6 additions & 4 deletions src/scenes/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default class MainGame extends Phaser.Scene {
this.player = this.physics.add.sprite(this.startX, 500, 'dude');
this.player.setBounce(0.06);
this.player.setCollideWorldBounds(true);
this.player.setFrictionX(0);
this.player.body.friction.x = 0;

// Player animation
this.anims.create({
Expand Down Expand Up @@ -148,25 +148,27 @@ export default class MainGame extends Phaser.Scene {
}

movePlayer() {
if (this.player.body.touching.down) this.player.jumpsAvailable = 1;
if (this.movingRight) {
this.player.anims.play('right', true);
if (this.player.body.touching.down) {
this.player.setVelocityX(160);
} else if (this.player.body.velocity.x <= 0) {
} else {
this.player.setVelocityX(85);
}
} else if (this.movingLeft) {
this.player.anims.play('left', true);
if (this.player.body.touching.down) {
this.player.setVelocityX(-160);
} else if (this.player.body.velocity.x >= 0) {
} else {
this.player.setVelocityX(-85);
}
} else {
this.player.anims.play('turn', true);
this.player.setVelocityX(0);
}
if (this.movingUp && this.player.body.touching.down) {
if (this.movingUp && this.player.jumpsAvailable > 0) {
this.player.jumpsAvailable -= 1;
this.player.body.velocity.y -= 400;
}
if (this.movingDown) {
Expand Down