Skip to content

Commit

Permalink
Merge pull request #18 from kuri-team/v0.1-alpha-development
Browse files Browse the repository at this point in the history
V0.1 alpha development
  • Loading branch information
miketvo authored Jan 13, 2021
2 parents 012c603 + bd9f5ca commit 8c166de
Show file tree
Hide file tree
Showing 36 changed files with 1,149 additions and 0 deletions.
10 changes: 10 additions & 0 deletions css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,13 @@ body {
padding: 0;
background-color: #000000;
}

footer {
padding-bottom: 5rem;
}

p {
color: white;
font-family: "Kenney Future", sans-serif;
text-align: center;
}
5 changes: 5 additions & 0 deletions game.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@
<div id="game-wrapper">
<script class="game" type="module" src="src/game.js"></script>
</div>
<p>Version 0.1 Alpha</p>
<p>Powered with <a href="https://phaser.io">Phaser 3</a></p>
</body>

<footer>
<p>Copyright Mike Vo & Team Kuri <script>document.write(new Date().getFullYear());</script> All rights reserved</p>
</footer>

</html>
Binary file added releases/v0.1-alpha/assets/font/Kenney Blocks.ttf
Binary file not shown.
Binary file not shown.
Binary file added releases/v0.1-alpha/assets/font/Kenney Future.ttf
Binary file not shown.
Binary file not shown.
Binary file added releases/v0.1-alpha/assets/font/Kenney High.ttf
Binary file not shown.
Binary file not shown.
Binary file added releases/v0.1-alpha/assets/font/Kenney Mini.ttf
Binary file not shown.
Binary file not shown.
Binary file added releases/v0.1-alpha/assets/font/Kenney Pixel.ttf
Binary file not shown.
Binary file not shown.
Binary file added releases/v0.1-alpha/assets/font/Kenney Rocket.ttf
Binary file not shown.
Binary file added releases/v0.1-alpha/assets/ost/lose.mp3
Binary file not shown.
Binary file added releases/v0.1-alpha/assets/sfx/dead.ogg
Binary file not shown.
Binary file added releases/v0.1-alpha/assets/sfx/shoot.ogg
Binary file not shown.
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.
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.
Binary file added releases/v0.1-alpha/assets/sprites/player/player.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 releases/v0.1-alpha/assets/sprites/ui/ui-health.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 70 additions & 0 deletions releases/v0.1-alpha/css/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
@font-face {
font-family: "Kenney Blocks";
src: url("../assets/font/Kenney Blocks.ttf") format("truetype");
}

@font-face {
font-family: "Kenney Future";
src: url("../assets/font/Kenney Future.ttf") format("truetype");
}

@font-face {
font-family: "Kenney Future Narrow";
src: url("../assets/font/Kenney Future Narrow.ttf") format("truetype");
}

@font-face {
font-family: "Kenney High";
src: url("../assets/font/Kenney High.ttf") format("truetype");
}

@font-face {
font-family: "Kenney High Square";
src: url("../assets/font/Kenney High Square.ttf") format("truetype");
}

@font-face {
font-family: "Kenney Mini";
src: url("../assets/font/Kenney Mini.ttf") format("truetype");
}

@font-face {
font-family: "Kenney Mini Square";
src: url("../assets/font/Kenney Mini Square.ttf") format("truetype");
}

@font-face {
font-family: "Kenney Pixel";
src: url("../assets/font/Kenney Pixel.ttf") format("truetype");
}

@font-face {
font-family: "Kenney Pixel Square";
src: url("../assets/font/Kenney Pixel Square.ttf") format("truetype");
}

@font-face {
font-family: "Kenney Rocket";
src: url("../assets/font/Kenney Rocket.ttf") format("truetype");
}

@font-face {
font-family: "Kenney Rocket Square";
src: url("../assets/font/Kenney Rocket Square.ttf") format("truetype");
}

body {
margin: 0;
padding: 0;
background-color: #000000;
}

footer {
padding-bottom: 5rem;
}

p {
color: white;
font-family: "Kenney Future", sans-serif;
text-align: center;
}
27 changes: 27 additions & 0 deletions releases/v0.1-alpha/game.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html lang="en">


<head>
<meta charset="UTF-8">
<title>Game</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" href="css/styles.css">

<script type="text/javascript" src="src/lib/phaser.min.js"></script>
</head>


<body>
<div id="game-wrapper">
<script class="game" type="module" src="src/game.js"></script>
</div>
<p>Version 0.1 Alpha</p>
<p>Powered with <a href="https://phaser.io">Phaser 3</a></p>
</body>

<footer>
<p>Copyright Mike Vo & Team Kuri <script>document.write(new Date().getFullYear());</script> All rights reserved</p>
</footer>

</html>
61 changes: 61 additions & 0 deletions releases/v0.1-alpha/src/game.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import GAMESETTINGS from "./settings.js";
import PreloadGame from "./scenes/PreloadGame.js";
import RunGame from "./scenes/RunGame.js";
import GameOver from "./scenes/GameOver.js";


let debug = false;
if (GAMESETTINGS.debug) {
debug = {
showVelocity: true,
showCollisions: true
}
}


let customFonts = [
'Kenney Blocks',
'Kenney Future',
'Kenney Future Narrow',
'Kenney High',
'Kenney High Square',
'Kenney Mini',
'Kenney Mini Square',
'Kenney Pixel',
'Kenney Pixel Square',
'Kenney Rocket',
'Kenney Rocket Square'
];


let config = {
backgroundColor: GAMESETTINGS.backgroundColor,
pixelArt: true,
type: Phaser.AUTO,
scale: {
parent: 'game-wrapper',
mode: Phaser.Scale.FIT,
autoCenter: Phaser.Scale.CENTER_HORIZONTALLY,
width: GAMESETTINGS.nativeWidth * GAMESETTINGS.scaleFactor,
height: GAMESETTINGS.nativeHeight * GAMESETTINGS.scaleFactor
},
physics: {
default: "matter",
matter: {
gravity: { x: GAMESETTINGS.gravity.x * GAMESETTINGS.scaleFactor, y: GAMESETTINGS.gravity.y * GAMESETTINGS.scaleFactor },
debug: debug
}
},
scene: [
PreloadGame, RunGame, GameOver
]
};

let game = new Phaser.Game(config);


export default {
game,
config,
customFonts
};
1 change: 1 addition & 0 deletions releases/v0.1-alpha/src/lib/phaser.min.js

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions releases/v0.1-alpha/src/lib/webfont.js

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

58 changes: 58 additions & 0 deletions releases/v0.1-alpha/src/scenes/GameOver.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import GAMESETTINGS from "../settings.js";
import game from "../game.js";


/***
* Game Over screen
*/
export default class GameOver extends Phaser.Scene {
constructor() {
super("gameOver");
}

/** @type {Phaser.GameObjects.Text} **/
restart;

/***
*
* @param {Object} data
*/
create(data) {
let clickSFX = this.sound.add('shoot-sfx');
this.sound.add('game-over-audio').play();

WebFont.load({
custom: {
families: game.customFonts
},
active: () => {
this.add.text(6.25 * GAMESETTINGS.scaleFactor, 2.5 * GAMESETTINGS.scaleFactor, `Game Over\nScore: ${data.score}`, {
fontSize: 15 * GAMESETTINGS.scaleFactor, fontFamily: 'Kenney High Square, Arial, sans-serif', color: '#000', fontStyle: 'bold'
});
this.restart = this.add.text(6.25 * GAMESETTINGS.scaleFactor, this.game.scale.height - 20 * GAMESETTINGS.scaleFactor, 'Restart', {
fontSize: 15 * GAMESETTINGS.scaleFactor, fontFamily: 'Kenney High Square, Arial, sans-serif', backgroundColor: '#000', fontStyle: 'bold', padding: {
left: 2.5 * GAMESETTINGS.scaleFactor,
right: 1.25 * GAMESETTINGS.scaleFactor,
top: 0,
bottom: 1.25 * GAMESETTINGS.scaleFactor
}
}).setInteractive();
}
});

this.add.sprite(
GAMESETTINGS.nativeWidth / 2 * GAMESETTINGS.scaleFactor,
GAMESETTINGS.nativeHeight / 2 * GAMESETTINGS.scaleFactor,
'vignette')
.setScale(GAMESETTINGS.scaleFactor)
.setAlpha(0.05)
.setBlendMode(Phaser.BlendModes.ADD)
.setScrollFactor(0, 0)
.play('vignette-anim');

this.input.on('gameobjectdown', () => {
clickSFX.play();
this.scene.start('runGame')
}, this);
}
}
Loading

0 comments on commit 8c166de

Please sign in to comment.