-
Notifications
You must be signed in to change notification settings - Fork 642
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
55563a2
commit d2f349f
Showing
25 changed files
with
744 additions
and
0 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 |
---|---|---|
@@ -1,2 +1,20 @@ | ||
SpaceInvaders | ||
============= | ||
This is a remake of the space invader phaser example, which you can find here: | ||
https://examples.phaser.io/ | ||
|
||
This remake is made with require.js, which breaks up the code into modules. | ||
Modules are in assets/javascript/module | ||
|
||
Code is more organized thanks to State and Statemanager class from Phaser. | ||
You can find the states in assets/javascript/state | ||
|
||
I used Phaser 2.0.1(no Physics) from the Dev branch. | ||
The dev branch has a lot of bug fixes so it's recommended to use it. | ||
|
||
Thanks to require.js, i made an optimized version of my game, | ||
which can be viewed with indexOpt.html. This use the "compiled" code, which can be found in assets/javascript/built | ||
|
||
Known issue: In every new play state(after the end state) the game makes new DOM nodes. | ||
The cause: in every cycle i make a new text to show the score. | ||
I tried to destroy the texts but i never succeed. |
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.
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,14 @@ | ||
/** | ||
* Created by stryker on 2014.03.23.. | ||
*/ | ||
/* | ||
* Build script | ||
* To use: npm install -g require.js | ||
* r.js -o built.js | ||
* */ | ||
|
||
({ | ||
baseUrl: ".", | ||
name: "main", | ||
out: "built/main-built.js" | ||
}) |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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,28 @@ | ||
/** | ||
* Created by stryker on 2014.03.05.. | ||
*/ | ||
require(['state/Load','state/Start','state/Play','state/End','lib/phaser-no-physics.min'],function(Load,Start,Play,End){ | ||
|
||
var _game = new Phaser.Game(800, 600, Phaser.AUTO, ''); | ||
|
||
|
||
//Load state | ||
Load.init(_game,'Start'); //args: game object, next state | ||
_game.state.add('Load',Load.getLoadState()); //args: state name, geting the load state | ||
|
||
//Start State | ||
Start.init(_game,'Play'); | ||
_game.state.add('Start',Start.getStartState()); | ||
|
||
//Play State | ||
Play.init(_game,'End'); | ||
_game.state.add('Play',Play.getPlayState()); | ||
|
||
//End State | ||
End.init(_game,'Play'); | ||
_game.state.add('End',End.getEndState()); | ||
|
||
//Starting the Load state | ||
_game.state.start('Load'); | ||
|
||
}); |
Oops, something went wrong.