-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
15 changed files
with
252 additions
and
2 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,19 @@ | ||
# jonga | ||
Physics based kung fu boss battle game for mini LD 62 | ||
# Jonga | ||
|
||
<!-- | ||
![](logo.png) | ||
--> | ||
Physics based kung fu boss battle game! | ||
|
||
<!-- | ||
Jonga is open source and made for [Mini LD 62](insert link here) | ||
[Play online now](insert link here) | ||
--> | ||
|
||
### Licenses | ||
|
||
Code is under MIT (see `LICENSE`); | ||
<!-- | ||
all assets are under [CC0](https://creativecommons.org/publicdomain/zero/1.0/) | ||
--> |
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,29 @@ | ||
<!DOCTYPE HTML> | ||
<title>Jonga</title> | ||
<html> | ||
<head> | ||
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> | ||
<style type="text/css"> | ||
body{ | ||
margin: 0; | ||
padding: 0; | ||
font-family: monospace; | ||
background-color: #12B2AD; | ||
} | ||
canvas { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
</style> | ||
<script src="scripts/phaser.min.js"></script> | ||
<script src="scripts/graphics.js"></script> | ||
<script src="scripts/main.js"></script> | ||
<script src="scripts/preload.js"></script> | ||
<script src="scripts/boot.js"></script> | ||
</head> | ||
<body> | ||
<div id="gameContainer"></div> | ||
<div id="fontLoader">Coconuts</div> | ||
<script src="scripts/index.js"></script> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name": "Jonga", | ||
"description": "Physics based kung fu boss battle game for mini LD 62", | ||
"launch_path": "/index.html", | ||
"icons": { | ||
"512": "images/icon-512.png", | ||
"128": "images/icon-128.png" | ||
}, | ||
"developer": { | ||
"name": "congusbongus", | ||
"url": "http://cxong.github.io" | ||
}, | ||
"default_locale": "en", | ||
"type": "web", | ||
"version": "1.0" | ||
} |
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,17 @@ | ||
BasicGame.Boot = function (game) { | ||
}; | ||
|
||
BasicGame.Boot.prototype = { | ||
|
||
preload: function () { | ||
this.game.load.image('bar_back', 'images/bar_back.png'); | ||
this.game.load.image('bar', 'images/bar.png'); | ||
}, | ||
|
||
create: function () { | ||
this.game.stage.backgroundColor = 0x00FFF6; | ||
this.input.maxPointers = 1; | ||
|
||
this.state.start('preload'); | ||
} | ||
}; |
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,6 @@ | ||
var SCREEN_WIDTH = 800; | ||
var SCREEN_HEIGHT = 480; | ||
|
||
var GROUND_Y = SCREEN_HEIGHT - 80; | ||
|
||
var GRAVITY = 990; |
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,10 @@ | ||
window.onload = function() { setTimeout(function () { | ||
document.getElementById('fontLoader').style.display = 'none'; | ||
var game = new Phaser.Game(SCREEN_WIDTH, SCREEN_HEIGHT, Phaser.AUTO, | ||
'gameContainer', null, false, | ||
false); | ||
game.state.add('boot', BasicGame.Boot); | ||
game.state.add('preload', BasicGame.Preload); | ||
game.state.add('game', GameState); | ||
game.state.start('boot'); | ||
}, 1000); }; |
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,99 @@ | ||
var GameState = function(game){}; | ||
|
||
GameState.prototype.preload = function() { | ||
}; | ||
|
||
GameState.prototype.create = function() { | ||
this.game.stage.backgroundColor = 0x00FFF6; | ||
this.game.physics.arcade.gravity.y = GRAVITY; | ||
|
||
this.sounds = { | ||
//hit: this.game.add.sound('hit'), | ||
}; | ||
|
||
this.groups = { | ||
bg: this.game.add.group(), | ||
enemies: this.game.add.group(), | ||
player: this.game.add.group(), | ||
enemyFists: this.game.add.group(), | ||
playerFists: this.game.add.group(), | ||
title: this.game.add.group() | ||
}; | ||
|
||
this.groups.bg.add(this.game.add.sprite(0, 0, 'bg')); | ||
//var sand = this.game.add.sprite(0, SCREEN_HEIGHT, 'sand'); | ||
//sand.anchor.y = 1; | ||
//this.groups.sand.add(sand); | ||
|
||
/* | ||
this.player = new Player( | ||
this.game, this.groups.tree, this.groups.coconuts, this.sounds, | ||
SCREEN_WIDTH / 2, SAND_Y, 'tree'); | ||
this.game.input.onDown.add(function() { | ||
this.attack(); | ||
}, this); | ||
this.game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR).onDown.add(function() { | ||
this.attack(); | ||
}, this); | ||
*/ | ||
|
||
//this.music = this.game.add.audio('music'); | ||
/* | ||
this.bigTextStyle = { | ||
font: "36px Courier New, monospace", | ||
fill: "#000", | ||
fontWeight: "bold" | ||
}; | ||
this.highStyle = { | ||
font: "36px Courier New, monospace", | ||
fill: "#f00", | ||
fontWeight: "bold" | ||
}; | ||
*/ | ||
|
||
this.title = this.game.add.sprite( | ||
SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, 'title'); | ||
this.title.anchor.setTo(0.5); | ||
|
||
this.started = false; | ||
|
||
this.readyTime = this.game.time.now + 1000; | ||
}; | ||
|
||
GameState.prototype.start = function() { | ||
//this.groups.tourists.removeAll(); | ||
|
||
this.timeLast = this.game.time.now; | ||
this.timeLastHalf = this.timeLast; | ||
//this.music.play('', 0, 1, true); | ||
|
||
this.title.alpha = 0; | ||
|
||
this.started = true; | ||
}; | ||
|
||
GameState.prototype.stop = function() { | ||
this.music.stop(); | ||
|
||
this.title.alpha = 1; | ||
|
||
this.started = false; | ||
|
||
this.readyTime = this.game.time.now + 1000; | ||
}; | ||
|
||
GameState.prototype.attack = function() { | ||
if (!this.started) { | ||
if (this.readyTime < this.game.time.now) { | ||
this.start(); | ||
} | ||
} else { | ||
//this.tree.attack(); | ||
} | ||
}; | ||
|
||
GameState.prototype.update = function() { | ||
/*this.game.physics.arcade.overlap( | ||
this.groups.coconuts, this.groups.tourists, function(coconut, tourist) { | ||
}, null, this);*/ | ||
}; |
Large diffs are not rendered by default.
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,29 @@ | ||
var BasicGame = {}; | ||
BasicGame.Preload = function (game) { | ||
this.preloadBar = null; | ||
}; | ||
|
||
BasicGame.Preload.prototype = { | ||
preload: function () { | ||
var barBack = this.add.sprite(SCREEN_WIDTH / 2, | ||
SCREEN_HEIGHT / 2, | ||
'bar_back'); | ||
barBack.anchor.setTo(0.5, 0.5); | ||
this.preloadBar = this.add.sprite(SCREEN_WIDTH / 2, | ||
SCREEN_HEIGHT / 2, | ||
'bar'); | ||
this.preloadBar.anchor.setTo(0, 0.5); | ||
this.preloadBar.x -= this.preloadBar.width / 2; | ||
this.load.setPreloadSprite(this.preloadBar); | ||
|
||
this.game.load.image('title', 'images/title.png'); | ||
this.game.load.image('bg', 'images/bg.png'); | ||
|
||
//this.game.load.audio('hit', 'sounds/hit.wav'); | ||
//this.game.load.audio('music', 'sounds/headinthesand.ogg'); | ||
}, | ||
|
||
create: function () { | ||
this.state.start('game'); | ||
} | ||
}; |