Commit b58f6185 authored by Arian Fornaris's avatar Arian Fornaris

Subir los codigos y release.

parent 759a4289
Pipeline #63 canceled with stages
Authors:
Rafael Martinez
Arian Fornaris
In the game appear the faces of some of some of the participants on the GGJ 2016 Cuba, THANKS THEM!!!!.
The game is an HTML5 app, so it can be executed in any modern web browser.
You must to host the game in a web server, if you want to run it locally, use a local server.
\ No newline at end of file
{
"level": [{
"type": "image",
"overwrite": false,
"key": "balcon",
"url": "assets/images/balcon.png"
}],
"meta": {
"app": "Phaser Editor",
"copyright": "Arian Fornaris (boniatillo.com) 2015",
"generated": "1454270931100",
"version": "1.0",
"url": "http://boniatillo.com"
},
"objects": [
{
"frameHeight": 240,
"margin": 0,
"frameWidth": 320,
"spacing": 0,
"frameMax": -1,
"type": "spritesheet",
"key": "wrong_puno",
"url": "assets/images/puno.jpg"
},
{
"frameHeight": 240,
"margin": 0,
"frameWidth": 320,
"spacing": 0,
"frameMax": -1,
"type": "spritesheet",
"key": "libs",
"url": "assets/objects/libs.jpg"
},
{
"frameHeight": 240,
"margin": 0,
"frameWidth": 320,
"spacing": 0,
"frameMax": -1,
"type": "spritesheet",
"key": "ritual",
"url": "assets/objects/ritual.jpg"
},
{
"frameHeight": 240,
"margin": 0,
"frameWidth": 320,
"spacing": 0,
"frameMax": -1,
"type": "spritesheet",
"key": "genero",
"url": "assets/objects/genero.jpg"
},
{
"frameHeight": 240,
"margin": 0,
"frameWidth": 320,
"spacing": 0,
"frameMax": -1,
"type": "spritesheet",
"key": "paz",
"url": "assets/objects/paz.jpg"
},
{
"frameHeight": 240,
"margin": 0,
"frameWidth": 320,
"spacing": 0,
"frameMax": -1,
"type": "spritesheet",
"key": "music",
"url": "assets/images/music.jpg"
},
{
"frameHeight": 240,
"margin": 0,
"frameWidth": 320,
"spacing": 0,
"frameMax": -1,
"type": "spritesheet",
"key": "flowers",
"url": "assets/images/flowers.jpg"
},
{
"frameHeight": 240,
"margin": 0,
"frameWidth": 320,
"spacing": 0,
"frameMax": -1,
"type": "spritesheet",
"key": "elefante",
"url": "assets/images/elefante.jpg"
},
{
"frameHeight": 240,
"margin": 0,
"frameWidth": 320,
"spacing": 0,
"frameMax": -1,
"type": "spritesheet",
"key": "wrong_factory",
"url": "assets/images/factory.png"
},
{
"frameHeight": 240,
"margin": 0,
"frameWidth": 320,
"spacing": 0,
"frameMax": -1,
"type": "spritesheet",
"key": "matica",
"url": "assets/images/matica.jpg"
},
{
"frameHeight": 240,
"margin": 0,
"frameWidth": 320,
"spacing": 0,
"frameMax": -1,
"type": "spritesheet",
"key": "river",
"url": "assets/images/river.jpg"
},
{
"frameHeight": 240,
"margin": 0,
"frameWidth": 320,
"spacing": 0,
"frameMax": -1,
"type": "spritesheet",
"key": "recycle",
"url": "assets/images/recycle.jpg"
},
{
"frameHeight": 240,
"margin": 0,
"frameWidth": 320,
"spacing": 0,
"frameMax": -1,
"type": "spritesheet",
"key": "ocean",
"url": "assets/images/ocean.jpg"
}
],
"start": [],
"faces": [
{
"frameHeight": 240,
"margin": 0,
"frameWidth": 320,
"spacing": 0,
"frameMax": -1,
"type": "spritesheet",
"key": "face7",
"url": "assets/faces/face7.jpg"
},
{
"frameHeight": 240,
"margin": 0,
"frameWidth": 320,
"spacing": 0,
"frameMax": -1,
"type": "spritesheet",
"key": "face1",
"url": "assets/faces/face1.jpg"
},
{
"frameHeight": 240,
"margin": 0,
"frameWidth": 320,
"spacing": 0,
"frameMax": -1,
"type": "spritesheet",
"key": "face2",
"url": "assets/faces/face2.jpg"
},
{
"frameHeight": 240,
"margin": 0,
"frameWidth": 320,
"spacing": 0,
"frameMax": -1,
"type": "spritesheet",
"key": "face3",
"url": "assets/faces/face3.jpg"
},
{
"frameHeight": 240,
"margin": 0,
"frameWidth": 320,
"spacing": 0,
"frameMax": -1,
"type": "spritesheet",
"key": "face4",
"url": "assets/faces/face4.jpg"
},
{
"frameHeight": 240,
"margin": 0,
"frameWidth": 320,
"spacing": 0,
"frameMax": -1,
"type": "spritesheet",
"key": "face5",
"url": "assets/faces/face5.jpg"
},
{
"frameHeight": 240,
"margin": 0,
"frameWidth": 320,
"spacing": 0,
"frameMax": -1,
"type": "spritesheet",
"key": "face6",
"url": "assets/faces/face6.jpg"
}
],
"preload": [
{
"type": "image",
"overwrite": false,
"key": "loading",
"url": "assets/images/loading.png"
},
{
"type": "image",
"overwrite": false,
"key": "dino",
"url": "assets/images/dino.png"
}
]
}
\ No newline at end of file
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport"
content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1">
<title>Phaser Editor - Basic</title>
<script src="lib/phaser.js"></script>
<script src="lib/hammer.min.js"></script>
<script src="lib/ScreenShake.js"></script>
<script src="js/Main.js"></script>
<script src="js/Boot.js"></script>
<script src="js/Menu.js"></script>
<script src="js/Preload.js"></script>
<script src="js/Level.js"></script>
<script src="js/Cell.js"></script>
<script src="js/Face.js"></script>
<script src="js/Data.js"></script>
<script src="js/Mapa.js"></script>
<script src="js/Target.js"></script>
<script src="js/Winner.js"></script>
<script src="js/GameOver.js"></script>
<style>
body {
background: #475fd9;
/* background-image: url('assets/images/background2.jpg'); */
/* background-repeat: repeat; */
margin: 0;
padding: 0;
margin: 0;
}
/*
html, body {
overflow-x: hidden;
}
body {
position: relative
}
*/
</style>
</head>
<body>
<script>
document.body.addEventListener('touchstart', function(e) {
e.preventDefault();
});
</script>
</body>
</html>
\ No newline at end of file
/**
* Boot state.
*/
function Boot() {
Phaser.State.call(this);
}
/** @type Phaser.State */
var proto = Object.create(Phaser.State);
Boot.prototype = proto;
Boot.prototype.init = function() {
this.game._level = 1;
this.game.stage.backgroundColor = "#475fd9";
// Unless you specifically know your game needs to support multi-touch I
// would recommend setting this to 1
this.input.maxPointers = 1;
// Setup the scale strategy
// this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;
this.scale.pageAlignHorizontally = true;
this.scale.pageAlignVertically = true;
};
Boot.prototype.preload = function() {
// Load the assets to be used in the Preload state (progress bar,
// etc...). Note we use the "preload" key of the asset pack. The rest of
// the assets should be loaded in the Preload state.
this.load.pack("preload", "assets/assets-pack.json");
};
Boot.prototype.create = function() {
// By this point the preloader assets have loaded to the cache, we've
// set the game settings, so now let's start the real preloader going
this.game.state.start("Preload");
this.game.plugins.screenShake = this.game.plugins
.add(Phaser.Plugin.ScreenShake);
this.game.plugins.screenShake.setup({
shakeX: true,
shakeY: false,
shakesCount: 3,
});
};
function moveInto(game, sprite, dir) {
var x = 0;
var y = 0;
switch (dir) {
case 'l':
x = -game.world.width;
break;
case 'r':
x = game.world.width;
break;
case 'u':
y = -game.world.height;
break;
case 'd':
y = game.world.height;
break;
}
sprite.reset(x, y);
game.add.tween(sprite).to({
x : 0,
y : 0
}, EASE_DELAY, EASE, true);
}
function moveAway(game, sprite, dir) {
var x = 0;
var y = 0;
switch (dir) {
case 'l':
x = game.world.width;
break;
case 'r':
x = -game.world.width;
break;
case 'u':
y = game.world.height;
break;
case 'd':
y = -game.world.height;
break;
}
var twn = game.add.tween(sprite).to({
x : x,
y : y
}, EASE_DELAY, EASE, true);
twn.onComplete.add(function() {
sprite.kill();
}, this);
}
function moveAwayAndBack(game, sprite, dir) {
var x = 0;
var y = 0;
switch (dir) {
case 'l':
x = game.world.width;
break;
case 'r':
x = -game.world.width;
break;
case 'u':
y = game.world.height;
break;
case 'd':
y = -game.world.height;
break;
}
game.add.tween(sprite).to({
x : x / 2,
y : y / 2
}, EASE_DELAY / 4, "Linear", true, 0, 0, true);
}
\ No newline at end of file
var FACES = [];
(function() {
for (var i = 1; i <= 7; i++) {
var face = {
name : "face" + i,
d : {
frames : [ 8, 9, 0, 1, 0 ],
fps : 3
},
l : {
frames : [ 8, 9, 4, 5, 4 ],
fps : 3
},
r : {
frames : [ 8, 9, 2, 3, 2 ],
fps : 3
},
u : {
frames : [ 8, 9, 6, 7, 6 ],
fps : 3
},
'?' : {
frames : [ 8, 9, 10, 11, 10 ],
fps : 3
}
};
FACES.push(face);
}
})();
var PUN = "wrong_puno";
var FAC = "wrong_factory";
var NUM_LEVELS = 3;
function createMap(i) {
return [ {
title : "el tema",
cells : [
[ "*", "?", "*" ],
[ "*", "?", "*" ],
[ "*", "*", "*" ] ],
targets : [ {
message : "ritual",
pos : [ 0, 2 ],
key : "ritual"
}, {
message : "busca otra gallina",
pos : [ 2, 0 ],
key : "genero",
}, {
message : "besos",
pos : [ 1, 2 ],
key : "paz"
} ]
},
{
title : "ritual: el amor",
cells : [
[ "*", "?", "*", "*" ],
[ PUN, "*", "*", PUN ],
[ "*", "*", "*", "*" ],
[ "*", "*", PUN, "*" ]
],
targets : [ {
pos : [ 2, 1 ],
key : "libs"
}, {
pos : [ 0, 3 ],
key : "music",
}, {
pos : [ 3, 0 ],
key : "flowers"
} ]
},
{
title : "la tierra",
cells : [
[ "*", FAC, "*", "*", FAC ],
[ "?", "*", "*", FAC, "*" ],
[ FAC, "*", "*", "*", "*" ],
[ "*", "*", FAC, "*", "*" ],
[ "*", "*", "*", "*", FAC ]
],
targets : [ {
pos : [ 2, 0 ],
key : "matica"
}, {
pos : [ 4, 2 ],
key : "river",
}, {
pos : [ 2, 2 ],
key : "elefante"
}, {
pos : [ 1, 4 ],
key : "recycle"
}, {
pos : [ 0, 0 ],
key : "ocean"
} ]
}
][i - 1];
}
var EASE = "Expo";
var EASE_DELAY = 500;
/**
* Face custom sprite.
*
* @param {Phaser.Game}
* game The game
* @param {Object}
* data The frames of each move (animation).
*/
function Face(game, data) {
this.game = game;
this.data = data;
this.sprite = this.game.add.sprite(-1000, -1000, this.data.name);
this.sprite.kill();
var names = [ "l", "r", "u", "d", "?" ];
for (var i = 0; i < names.length; i++) {
var name = names[i];
var item = this.data[name];
this.sprite.animations.add(name, item.frames, item.fps, true);
}
var front = game.add.sprite(-1000, -1000, "balcon");
this.sprite.update = function() {
if (this.alive != front.alive) {
if (this.alive) {
front.kill();
} else {
front.reset(0, 0);
}
}
front.x = this.x;
front.y = this.y;
};
}
Face.prototype = Object.create(Object.prototype);
Face.prototype.constructor = Face;
Face.prototype.isInPlace = function() {
return this.sprite.x == 0 && this.sprite.y == 0;
};
Face.prototype.playRole = function(dir) {
moveInto(this.game, this.sprite, dir);
this.sprite.animations.play(this.cellmove);
};
Face.prototype.moveAway = function