Skip to content

Commit

Permalink
Add simple Main Menu
Browse files Browse the repository at this point in the history
  • Loading branch information
diguifi committed Sep 6, 2018
1 parent 706cac6 commit c660ea1
Show file tree
Hide file tree
Showing 17 changed files with 112 additions and 28 deletions.
9 changes: 9 additions & 0 deletions Dude-SideScroller.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@
<TypeScriptSourceRoot />
</PropertyGroup>
<ItemGroup>
<Content Include="assets\buttons\button-diagonal.png" />
<Content Include="assets\buttons\button-horizontal.png" />
<Content Include="assets\buttons\button-round-a.png" />
<Content Include="assets\buttons\button-round-b.png" />
<Content Include="assets\buttons\button-round.png" />
<Content Include="assets\buttons\button-vertical.png" />
<Content Include="assets\images\back.png" />
<Content Include="assets\images\logo.png" />
<Content Include="assets\levels\level1tiles.png" />
<Content Include="assets\sprites\dude_spritesheet.png" />
<Content Include="build\phaser.map" />
Expand All @@ -82,6 +90,7 @@
<TypeScriptCompile Include="scripts\Enemy.ts" />
<TypeScriptCompile Include="scripts\Game.ts" />
<TypeScriptCompile Include="scripts\levels\Level1.ts" />
<TypeScriptCompile Include="scripts\MainMenu.ts" />
<TypeScriptCompile Include="scripts\Player.ts" />
</ItemGroup>
<ItemGroup>
Expand Down
Binary file added assets/images/back.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<link rel="stylesheet" href="style/app.css" type="text/css" />
<script src="engine/phaser.js"></script>
<script src="scripts/levels/Level1.js"></script>
<script src="scripts/MainMenu.js"></script>
<script src="scripts/ControllerManager.js"></script>
<script src="scripts/Player.js"></script>
<script src="scripts/Enemy.js"></script>
Expand All @@ -17,7 +18,7 @@

<body>

<center><h1>I guess now they do something</h1></center>
<center><h1>Not very pretty, but works</h1></center>

<div id="content"></div>

Expand Down
2 changes: 1 addition & 1 deletion scripts/ControllerManager.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions scripts/Enemy.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/Enemy.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion scripts/Game.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/Game.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion scripts/Game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
false,
Phaser.Physics.Arcade
);
this.game.state.add('MainMenu', MainMenu, false);
this.game.state.add('Level1', Level1, false);
}

Expand All @@ -24,6 +25,9 @@
this.game.load.spritesheet('dude', 'assets/sprites/dude_spritesheet.png?v=1', 16, 25, 4);
this.game.load.image('enemy1', 'assets/sprites/enemy.png?v=1');

this.game.load.image('titlepage', 'assets/images/back.png');
this.game.load.image('logo', 'assets/images/logo.png');

this.game.load.spritesheet('tiles_level1', 'assets/levels/level1tiles.png', 16, 16);
this.game.load.tilemap('tileMap_level1', 'assets/levels/level1.json', null, Phaser.Tilemap.TILED_JSON);

Expand All @@ -49,7 +53,7 @@
this.game.physics.arcade.gravity.y = 200;
this.game.stage.backgroundColor = "#4286f4";

this.game.state.start('Level1');
this.game.state.start('MainMenu');
}
}
}
Expand Down
Loading

0 comments on commit c660ea1

Please sign in to comment.