-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #150 from left23/master
refactor plates 001, 013, 020
- Loading branch information
Showing
9 changed files
with
82 additions
and
189 deletions.
There are no files selected for viewing
127 changes: 0 additions & 127 deletions
127
components/com_battle/views/plate/tmpl/001_consumer/-script.js
This file was deleted.
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 |
---|---|---|
|
@@ -16,4 +16,3 @@ | |
</body> | ||
</html> | ||
|
||
|
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
36 changes: 17 additions & 19 deletions
36
components/com_battle/views/plate/tmpl/013_are_you_insane/default.php
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,23 +1,21 @@ | ||
<html> | ||
<head> | ||
<!-- Phaser --> | ||
<script src="/components/com_battle/views/phaser/tmpl/_site/js/phaser.js"></script> | ||
<style> | ||
body { | ||
margin: 0; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="world"> | ||
</div> | ||
<script src='http://eclecticmeme.com/components/com_battle/views/plate/tmpl/013_are_you_insane/script.js'></script> | ||
</body> | ||
<head> | ||
<!-- Phaser --> | ||
<script src="/components/com_battle/includes/phaser.js"></script> | ||
<style> | ||
body { | ||
margin: 0; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="world"> | ||
</div> | ||
<script src='state001.js'></script> | ||
<script src='script.js'></script> | ||
</body> | ||
</html> | ||
|
||
|
||
|
||
|
28 changes: 8 additions & 20 deletions
28
components/com_battle/views/plate/tmpl/013_are_you_insane/script.js
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,23 +1,11 @@ | ||
var game = new Phaser.Game(640, 480, Phaser.CANVAS, 'world', { preload: preload, create: create }); | ||
// we create the global game object, an instance of Phaser.Game | ||
|
||
function preload () { | ||
var game = new Phaser.Game(800, 500, Phaser.AUTO, 'world'); | ||
|
||
// You can fill the preloader with as many assets as your game requires | ||
// the first parameter is the key you use to jump between stated | ||
// the key must be unique within the state manager | ||
// the second parameter is the object that contains the state code | ||
// these come from the js files we included in the head tag in the html file | ||
game.state.add('State001', are_you_insane.State001); | ||
|
||
// Here we are loading an image. The first parameter is the unique | ||
// string by which we'll identify the image later in our code. | ||
|
||
// The second parameter is the URL of the image (relative) | ||
game.load.image('plate', 'are_you_insane.jpg'); | ||
|
||
} | ||
|
||
function create() { | ||
|
||
// This creates a simple sprite that is using our loaded image and | ||
// displays it on-screen and assign it to a variable | ||
var image = game.add.sprite(game.world.centerX, game.world.centerY, 'plate'); | ||
|
||
// Moves the image anchor to the middle, so it centers inside the game properly | ||
image.anchor.set(0.5); | ||
} | ||
game.state.start('State001'); |
34 changes: 34 additions & 0 deletions
34
components/com_battle/views/plate/tmpl/013_are_you_insane/state001.js
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,34 @@ | ||
// defining a single global object (are_you_insane) and adding some functions in to its prototype (eg preload, create functions) | ||
|
||
var are_you_insane = {}; | ||
|
||
|
||
are_you_insane.State001 = function (game) { | ||
|
||
|
||
}; | ||
|
||
are_you_insane.State001.prototype = { | ||
|
||
preload: function () { | ||
|
||
// You can fill the preloader with as many assets as your game requires | ||
|
||
// Here we are loading an image. The first parameter is the unique | ||
// string by which we'll identify the image later in our code. | ||
|
||
// The second parameter is the URL of the image (relative) | ||
this.load.image('plate', 'are_you_insane.jpg'); | ||
|
||
}, | ||
create: function () { | ||
|
||
// This creates a simple sprite that is using our loaded image and | ||
// displays it on-screen and assign it to a variable | ||
var image = this.add.sprite(game.world.centerX, game.world.centerY, 'plate'); | ||
|
||
// Moves the image anchor to the middle, so it centers inside the game properly | ||
image.anchor.set(0.5); | ||
|
||
} | ||
} |
1 change: 0 additions & 1 deletion
1
components/com_battle/views/plate/tmpl/020_zombies_from_space/default.php
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
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