Skip to content

Commit 4a19e43

Browse files
author
Thomas
committed
removed a useless ".prototype"
1 parent e8859db commit 4a19e43

11 files changed

Lines changed: 10 additions & 22 deletions

File tree

1-introduction/empty-project.zip

0 Bytes
Binary file not shown.

1-introduction/hello-world.zip

-93 Bytes
Binary file not shown.

1-introduction/hello-world/main.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@
22
// Parameters: width of the game, height of the game, how to render the game, the name of the div in the html that will contain the game
33
var game = new Phaser.Game(500, 600, Phaser.AUTO, 'game_div');
44

5-
// This is an array to store the different states of our game. A state is a specific scene of a game like a menu, a game over screen, etc.
6-
var game_state = {};
7-
85
// And now we define our first and only state, I'll call it 'main'
9-
game_state.main = function(game) { };
10-
game_state.main.prototype = {
6+
var main_state = {
117

128
preload: function() {
139
// Everything in this function will be executed at the beginning. That’s where we usually load the
@@ -34,5 +30,5 @@ game_state.main.prototype = {
3430
}
3531

3632
// And finally we tell Phaser to add and start our 'main' state
37-
game.state.add('main', game_state.main);
33+
game.state.add('main', main_state);
3834
game.state.start('main');

2-flappy_bird/basic_template.zip

-19 Bytes
Binary file not shown.

2-flappy_bird/basic_template/main.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
// Initialize Phaser, and creates a 400x490px game
22
var game = new Phaser.Game(400, 490, Phaser.AUTO, 'game_div');
3-
var game_state = {};
43

54
// Creates a new 'main' state that wil contain the game
6-
game_state.main = function() { };
7-
game_state.main.prototype = {
5+
var main_state = {
86

97
preload: function() {
108
// Function called first to load all the assets
@@ -20,5 +18,5 @@ game_state.main.prototype = {
2018
};
2119

2220
// Add and start the 'main' state to start the game
23-
game.state.add('main', game_state.main);
21+
game.state.add('main', main_state);
2422
game.state.start('main');

2-flappy_bird/flappy_bird.zip

-27 Bytes
Binary file not shown.

2-flappy_bird/flappy_bird/main.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
// Initialize Phaser, and creates a 400x490px game
22
var game = new Phaser.Game(400, 490, Phaser.AUTO, 'game_div');
3-
var game_state = {};
43

54
// Creates a new 'main' state that will contain the game
6-
game_state.main = function() { };
7-
game_state.main.prototype = {
5+
var main_state = {
86

97
// Function called first to load all the assets
108
preload: function() {
@@ -97,5 +95,5 @@ game_state.main.prototype = {
9795
};
9896

9997
// Add and start the 'main' state to start the game
100-
game.state.add('main', game_state.main);
98+
game.state.add('main', main_state);
10199
game.state.start('main');
-22 Bytes
Binary file not shown.

3-flappy_bird/flappy_bird_basic/main.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
var game = new Phaser.Game(400, 490, Phaser.AUTO, 'game_div');
2-
var game_state = {};
32

4-
game_state.main = function() { };
5-
game_state.main.prototype = {
3+
var main_state = {
64

75
preload: function() {
86
this.game.stage.backgroundColor = '#71c5cf';
@@ -61,5 +59,5 @@ game_state.main.prototype = {
6159
},
6260
};
6361

64-
game.state.add('main', game_state.main);
62+
game.state.add('main', main_state);
6563
game.state.start('main');
-21 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)