-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TechDebt/refactor levels in order to sperate logic from content
- Loading branch information
1 parent
3fa9514
commit ff820e3
Showing
5 changed files
with
201 additions
and
171 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ mongoose-free-6.5.exe | |
node_modules | ||
dist/js/app.js | ||
dist | ||
npm-debug.log |
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 |
---|---|---|
@@ -1,82 +1,35 @@ | ||
import {GameState} from '../gameState' | ||
import {LevelPrototype} from './levelPrototype' | ||
let gState = new GameState().state; | ||
//set local pointers; | ||
|
||
export class Level1{ | ||
|
||
|
||
constructor() { | ||
this.playerStartingX = 10; | ||
this.playerStartingY = 10; | ||
} | ||
|
||
addStartingText(){ | ||
var loadingLabel = game.add.text(80, 278, 'Kill the evil slime! -->', {font: '20px Courier', fill: '#fff'}); | ||
setTimeout(function(){ | ||
loadingLabel.kill(); | ||
}, 5000); | ||
} | ||
|
||
createBackground(){ | ||
game.world.setBounds(0, 0, 885, 376); | ||
|
||
game.add.sprite(0, 0, 'game-background'); | ||
game.add.sprite(640, 0, 'game-background'); | ||
} | ||
|
||
addPlatforms(){ | ||
gState.envObjects.platforms.create(0, 300, 'platform'); | ||
gState.envObjects.platforms.create(197, 300, 'platform2'); | ||
gState.envObjects.platforms.create(506, 300, 'platform'); | ||
gState.envObjects.platforms.create(646, 300, 'platform'); | ||
gState.envObjects.platforms.create(646, 112, 'tower1'); | ||
} | ||
|
||
addArrows(arrows){ | ||
} | ||
|
||
addRedSlimes(){ | ||
gState.enemies.redSlimes.create(670, 10, 'monster2'); | ||
} | ||
|
||
addFallers(){ | ||
gState.envObjects.fallers.create(340, 282, 'faller'); | ||
} | ||
|
||
addSlowFallers(){ | ||
} | ||
|
||
addTrampolines(){ | ||
gState.envObjects.trampolines.create(600, 270, 'trampoline'); | ||
} | ||
|
||
addLava(){ | ||
gState.envObjects.lava.create(141, 332, 'lava'); | ||
gState.envObjects.lava.create(254, 332, 'lava2'); | ||
gState.envObjects.lava.create(700, 332, 'lava2'); | ||
} | ||
|
||
addSwitchFallers(){ | ||
} | ||
|
||
addEndingText(){ | ||
game.add.text(gState.player.x - 200, 100, 'Great!', | ||
{font: '40px Courier', fill: '#fff'}); | ||
game.add.text(gState.player.x - 200, 136, 'Time for the next one....', | ||
{font: '20px Courier', fill: '#fff'}); | ||
} | ||
|
||
addTnt(){ | ||
} | ||
|
||
addRiders(){ | ||
} | ||
|
||
handleRidersLogic(){ | ||
} | ||
|
||
checkForCoolKillText(){ | ||
} | ||
|
||
|
||
let lvl = { | ||
platforms: [ | ||
{ x:0, y: 300, type: 'platform' }, | ||
{ x:197, y: 300, type: 'platform2' }, | ||
{ x:506, y: 300, type: 'platform' }, | ||
{ x:646, y: 300, type: 'platform' }, | ||
{ x:646, y: 112, type: 'tower1' } | ||
], | ||
redSlimes: [ | ||
{ x: 670,y: 10, type: 'monster2' } | ||
], | ||
fallers: [ | ||
{ x: 340, y: 282, type: 'faller' } | ||
], | ||
slowFallers: [], | ||
trampolines: [ { x: 600, y: 270, type: 'trampoline' } ], | ||
lava: [ | ||
{ x:141, y: 332, type: 'lava' }, | ||
{ x:254, y: 332, type: 'lava2' }, | ||
{ x:700, y: 332, type: 'lava2' } | ||
], | ||
tnt: [], | ||
riders: [], | ||
switchFallers: [] | ||
} | ||
export class Level1 extends LevelPrototype { | ||
constructor() { | ||
super(); | ||
this.levelObj = lvl | ||
} | ||
} |
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
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
Oops, something went wrong.