Commit 1af73132 authored by Pablo R. Mier's avatar Pablo R. Mier

clean unused code

parent ee82b382
......@@ -18,6 +18,11 @@ invadersApp.Boot.prototype = {
{
// If you have any desktop specific settings, they can go in here
this.scale.pageAlignHorizontally = true;
//this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;
var scale = (window.innerWidth/960) * 0.8;
this.scale.setUserScale(scale, scale);
this.scale.scaleMode = Phaser.ScaleManager.USER_SCALE;
}
else
{
......@@ -40,7 +45,6 @@ invadersApp.Boot.prototype = {
this.load.image('preloaderBackground', 'assets/background.png');
this.load.image('retroFont', 'assets/fonts/font3.png');
this.load.image('preloaderBar', 'assets/preload.png');
this.load.bitmapFont('minecraftia', 'assets/fonts/minecraftia.png', 'assets/fonts/minecraftia.xml');
},
......
......@@ -10,50 +10,30 @@ invadersApp.MainMenu.prototype = {
create: function () {
this.mainMusic = this.add.audio('mainMusic');
//this.mainMusic.play('', 0, 1, true, true);
var textTop = invadersApp.utils.addText(this, this.game.width / 2, 50, 'CITIUS PROUDLY PRESENTS:' , 2);
textTop.alpha = 0;
//var companyText = this.add.bitmapText(this.game.width / 2, 50, 'minecraftia', 'CiTIUS PROUDLY PRESENTS:', 16);
//companyText.anchor.x = 0.5;
/*
var presentsText = this.add.bitmapText(this.game.width / 2, companyText.y + 30, 'minecraftia', 'PROUDLY PRESENTS:', 16);
presentsText.anchor.x = 0.5;
*/
var titleYPos = this.game.height / 3;
var title = this.add.sprite(this.game.width / 2, -100, 'title');
title.anchor.setTo(0.5, 0.5);
/*
var copyright = this.add.sprite(this.game.width / 2, this.game.height - 30, 'copyright');
copyright.anchor.setTo(0.5, 0.5);*/
var logo = this.add.sprite(this.game.width / 2, this.game.height - 60, 'logo');
logo.anchor.setTo(0.5, 0.5);
logo.scale.setTo(0.6, 0.6);
logo.visible = false;
//var titleText = this.add.bitmapText(this.game.width / 2, 50, 'minecraftia', 'CiTIUS INVADERS', 50);
//titleText.anchor.x = 0.5;
var textIES = invadersApp.utils.addText(this, this.game.width / 2, titleYPos + 50, 'A GAME FOR IES ROSALIA DE CASTRO', 1);
textIES.img.visible = false;
var textPressStart = invadersApp.utils.addText(this, this.game.width / 2, titleYPos + 200, 'PRESS ENTER', 2);
textPressStart.img.visible = false;
//var startEntry = this.addMenuEntry('START GAME', titleYPos + 160, this.startGame);
//this.addMenuEntry('CONFIGURE', startEntry.y + 40);
var textCopyright = invadersApp.utils.addText(this, this.game.width / 2, logo.y + 40, 'CENTRO SINGULAR DE INVESTIGACION EN TECNOLOXIAS DA INFORMACION', 1);
textCopyright.img.visible = false;
var tweenPresents = this.game.add.tween(textTop).to( { alpha: 1 }, 800, Phaser.Easing.Linear.None, false, 200);
var tweenTitle = this.game.add.tween(title).to( { y: this.game.height / 3 }, 1200, Phaser.Easing.Bounce.Out, false);
tweenPresents.chain(tweenTitle);
......@@ -75,8 +55,6 @@ invadersApp.MainMenu.prototype = {
textPressStart.img.visible = !textPressStart.img.visible;
}, this);
//this.mainMusic.play('', 0, 1, true, true);
}, this);
// Start animated chain
......
......@@ -12,18 +12,13 @@ invadersApp.Preloader.prototype = {
preload: function () {
// These are the assets we loaded in Boot.js
// this.background = this.game.add.tileSprite(0, 0, this.game.width, this.game.height, 'preloaderBackground');
//var loadingText = this.add.bitmapText(this.game.width / 2, this.game.height / 2 - 60, 'minecraftia', 'Loading...');
var loadingText = invadersApp.utils.addText(this, this.game.width / 2, this.game.height / 2 - 60, 'Loading...', 3);
//loadingText.anchor.x = 0.5;
//loadingText.anchor.setTo(0.5, 0.5);
this.preloadBar = this.add.sprite(this.game.width / 2, loadingText.img.y + 40, 'preloaderBar');
this.preloadBar.anchor.setTo(0.5, 0.5);
//this.preloadBar.tint =
// This sets the preloadBar sprite as a loader sprite.
// What that does is automatically crop the sprite from 0 to full-width
// as the files below are loaded in.
......@@ -32,7 +27,7 @@ invadersApp.Preloader.prototype = {
// Here we load the rest of the assets our game needs.
// As this is just a Project Template I've not provided these assets, swap them for your own.
this.load.image('titlepage', 'assets/title.png');
//this.load.atlas('playButton', 'images/play_button.png', 'images/play_button.json');
this.load.audio('titleMusic', ['assets/audio/bodenstaendig_2000_in_rock_4bit.ogg']);
this.load.audio('gameOverMusic', ['assets/audio/invaders_gameover.ogg']);
this.load.audio('mainMusic', ['assets/audio/invaders_mainloop.ogg']);
......
......@@ -23,18 +23,14 @@
window.onload = function() {
// Create your Phaser game and inject it into the gameContainer div.
// We did it in a window.onload event, but you can do it anywhere (requireJS load, anonymous function, jQuery dom ready, - whatever floats your boat)
var game = new Phaser.Game(960, 540, Phaser.AUTO, 'gameContainer');
// Add the States your game has.
// You don't have to do this in the html, it could be done in your Boot state too, but for simplicity I'll keep it here.
game.state.add('Boot', invadersApp.Boot);
game.state.add('Preloader', invadersApp.Preloader);
game.state.add('MainMenu', invadersApp.MainMenu);
game.state.add('Game', invadersApp.Game);
// Now start the Boot state.
game.state.start('Boot');
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment