Jump to content

Menu/Info screen before start game


Mizukage
 Share

Recommended Posts

Hello again,

 

I have no idea how can I make welcome screen, because I wrote whole game code in one .js file :/ 
I didn't know before and now I cant handle change this code and seperate it 

 

Atm my game start like

<!DOCTYPE html><html><head>  <meta charset="utf-8">  <title>Shinobi Battle</title>      <script src="phaser.js"></script>  <script src="game.js"></script>    <link rel="stylesheet" href="style.css"></head> <body>  <div id="game"></div></body> </html>
var game = new Phaser.Game(1000, 600, Phaser.AUTO, '',   {    preload: preload,    create: create,     update: update  });function preload() { ..........
Link to comment
Share on other sites

Hello,

 

what you are looking for are phaser states. There are numerous tutorials, basically every tutorial uses states, shortly described: each state can represent each of your game screens (loading screen, menu, main game, ...) - well options are a bit broader but this is basic.

Every state has it's own load, create, update, ... functions (you can exchange data between them i.e. for score screen).

 

Btw it doesn't matter whether you use one js file or multiple.

 

Is this ok for you, just go to phaser webpage or google any game example.

 

PS: In this fiddle you can see one state example (at the last two lines you are adding state and then starting it - if you need more states you are add then consequentially at the same time and then to jump from one state to another you just use game.state.start(state name), in my example there is only one state called mainstate. Usually games have more states (i.e. boot, load, main, ....) you can see and use one of the templates phaser provides you with, just open your phaser directory and go to "Resources/Project Templates" there you get all you need to start your game ;-).

Link to comment
Share on other sites

Go through this, it's the basics about setting up your project with phaser.

 

Otherwise you can check:

 

this one will take you through the whole process of creating the game with states step by step (don't miss this one you can find everything you need in it!!!),

and this one for some basics http://www.gamedevacademy.org/make-a-html5-platformer-with-phaser/

 

Btw did you check the resource folder as I suggested above? You can find the code where you just put yourgame piece by piece, so check it as well!

Link to comment
Share on other sites

I've had the same question myself. Mizukage, Azrael thank you for the links. I'll read them and digest them. 

 

When I arrive at an answer, I will write a tutorial and post it at codetowin.io

I will address this question directly and as succinctly as possible.  I'll post it in the Phaser tutorials thread. Mizukage ,keep your eyes open early next week :)

Link to comment
Share on other sites

Hi, could you expand on what exactly is not working for you, or which part do you not understand precisely? What you tried to do would help quite a lot as well, that way we can see which part of your new code is wrong.

 

I'll try to show a simple setting, I'll go with basic phaser template.

 

Files will be like this: index.html, boot.js, game.js, mainmenu.js, preloader.js.

 

 

a/ index.html

<!DOCTYPE HTML><html><head>    <meta charset="UTF-8" />    <title>Phaser Basic Project Template</title>    <script src="phaser.min.js"></script>    <script src="boot.js"></script>    <script src="preloader.js"></script>    <script src="mainMenu.js"></script>    <script src="game.js"></script></head><body><div id="gameContainer"></div><script type="text/javascript">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(1024, 768, 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', BasicGame.Boot);    game.state.add('Preloader', BasicGame.Preloader);    game.state.add('MainMenu', BasicGame.MainMenu);    game.state.add('Game', BasicGame.Game);    //    Now start the Boot state.    game.state.start('Boot');};</script></body></html>

Here new Phaser.Game is created and palced in gameContainer div, then we add game states to our phaser game with game.state.add(key, object), therefore for our four states (we separated them in four different files but you can place them in one file, it doesn't matter (separating them makes it easier to read the whole thing that's all). First boot state is added with name 'Boot' and object representing this state is BasicGame.Boot.

 

game.state.add('Boot', BasicGame.Boot);

 

This way we added first state to our game // don't forget that game is: var game = new Phaser.Game(..);

Similar way you add remaining states as is seen above.

 

Now we need to type some code to actually have BasicGame object with its methods: Boot, Preloader, MainMenu, Game. As mentioned before we separate each of these methods into a separate file for easier navigation in hiearchy (easy to read).

 

b/ boot.js

var BasicGame = {};BasicGame.Boot = function (game) {};BasicGame.Boot.prototype = {    init: function () {        //  Unless you specifically know your game needs to support multi-touch I would recommend setting this to 1        this.input.maxPointers = 1;        //  Phaser will automatically pause if the browser tab the game is in loses focus. You can disable that here:        this.stage.disableVisibilityChange = true;        if (this.game.device.desktop)        {            //  If you have any desktop specific settings, they can go in here            this.scale.pageAlignHorizontally = true;        }        else        {            //  Same goes for mobile settings.            //  In this case we're saying "scale the game, no lower than 480x260 and no higher than 1024x768"            this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;            this.scale.setMinMax(480, 260, 1024, 768);            this.scale.forceLandscape = true;            this.scale.pageAlignHorizontally = true;        }    },    preload: function () {        //  Here we load the assets required for our preloader (in this case a background and a loading bar)        this.load.image('preloaderBackground', 'images/preloader_background.jpg');        this.load.image('preloaderBar', 'images/preloadr_bar.png');    },    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.state.start('Preloader');    }};

Here is the boot.js file where we define our BasicGame variable as an object and set up it's Boot method:

var BasicGame = {};BasicGame.Boot = function (game) {};

Now it's the same as you were doing before and as I mentioned before as well, each state has it's own init, preload, create, update, ..., methods. In Boot we only want to set some settings before the game assets (images for sprites, sound files, ...) start loading, this way we can set scaleMode, pageAlign, and so on. You do it before loading game assets because if you don't want people who play your game to wait until their browsers downloads the images and sounds to set for example screen orientation or if the game should be centered on the screen (these are actions you want to do as soon as possible otherwise it looks weird for any user, doesn't it?).

 

We set the basic settings in init method (phaser goes through init method first, then preload, create, update, ...) then we want to load some images for our loading screen because you want to give some feedback to the player while he is waiting until all the game assets are loaded (it can be a simple bar which will be gettin filled as the game gets loaded, or anything else). We do that in preload method as you can see.

 

After we have our settings correct (BasicGame.Boot.prototype.init) and assets for loading page are loaded (BasicGame.Boot.prototype.preload) we want to the game to progress to star loading its assets therefore we switch from BasicGame.Boot state to BasicGame.Preloader state with this.state.start('Preloader'); ('Preloader' is the name we gave it in step a/ index.html do you remember?) and we do this in BasicGame.Boot.prototype.create method because this one will be called after init and preload are finished.

 

Now we succesfuly set the game settings, loaded loading screen assets and switched to Preloader state.

 

c/ preloader.js

BasicGame.Preloader = function (game) {    this.background = null;    this.preloadBar = null;    this.ready = false;};BasicGame.Preloader.prototype = {    preload: function () {        //    These are the assets we loaded in Boot.js        //    A nice sparkly background and a loading progress bar        this.background = this.add.sprite(0, 0, 'preloaderBackground');        this.preloadBar = this.add.sprite(300, 400, 'preloaderBar');        //    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.        this.load.setPreloadSprite(this.preloadBar);        //    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', 'images/title.jpg');        this.load.atlas('playButton', 'images/play_button.png', 'images/play_button.json');        this.load.audio('titleMusic', ['audio/main_menu.mp3']);        this.load.bitmapFont('caslon', 'fonts/caslon.png', 'fonts/caslon.xml');        //    + lots of other required assets here    },    create: function () {        //    Once the load has finished we disable the crop because we're going to sit in the update loop for a short while as the music decodes        this.preloadBar.cropEnabled = false;    },    update: function () {        //    You don't actually need to do this, but I find it gives a much smoother game experience.        //    Basically it will wait for our audio file to be decoded before proceeding to the MainMenu.        //    You can jump right into the menu if you want and still play the music, but you'll have a few        //    seconds of delay while the mp3 decodes - so if you need your music to be in-sync with your menu        //    it's best to wait for it to decode here first, then carry on.                //    If you don't have any music in your game then put the game.state.start line into the create function and delete        //    the update function completely.                if (this.cache.isSoundDecoded('titleMusic') && this.ready == false)        {            this.ready = true;            this.state.start('MainMenu');        }    }};

Well there is nothing much, just go through the comments, your preloader function should be here in preload something like this:

BasicGame.Preloader = function (game) {    this.background = null;    this.preloadBar = null;    this.ready = false;};BasicGame.Preloader.prototype = {    preload: function () {      this.game.load.image('ancienttemple', 'assets/img2/background.jpg');      this.load.image('ground', 'assets/img2/ground.png');      this.load.image('vial', 'assets/img2/hp.png');      this.load.image('shuriken', 'assets/img2/shuriken.png');      this.load.image('shuriken_gold', 'assets/img2/shuriken_gold.png');      this.load.image('shuriken_silver', 'assets/img2/shuriken_silver.png');      this.load.spritesheet('player_sprite', 'assets/img/ninja.png', 47.71, 54);      //Jak wybrac inny fragemtn obrazka??      this.load.spritesheet('enemy_sprite', 'assets/img/ninja2.png', 47.71, 54);      this.load.spritesheet('shu_animation', 'assets/img2/hit2.png');      this.load.spritesheet('blood_animation', 'assets/img2/blood2.png', 78, 78);        this.load.audio('clash1_fx', 'assets/fx/clash3.wav');      this.load.audio('clash2_fx', 'assets/fx/clash4.wav');      this.load.audio('stab_fx', 'assets/fx/stab.wav');      this.load.audio('fall_fx', 'assets/fx/fall.wav');      this.load.audio('jump_fx', 'assets/fx/jump1.wav');      this.load.audio('throw_1_fx', 'assets/fx/throw_1.wav');      this.load.audio('throw_2_fx', 'assets/fx/throw_2.wav');      this.load.audio('heal_up_fx', 'assets/fx/heal_up.wav');    },    create: function () {      this.state.start('MainMenu');    }};

d/ mainmenu.js

 

I'll skip the main menu, you can check it in your phaser directory navigating to resources/Project Templates/Basic/, the name of the file explains all it is about and how to switch states witch (state.start) shouldn't be a problem for you, so if you have any mainmenu simple created it here (probably in create method, and then in update just check whether player clicked on start or not, if yes than this.state.start('Game') and your game starts!

 

e/ game.js

BasicGame.Game = function (game) {    //  When a State is added to Phaser it automatically has the following properties set on it, even if they already exist:    this.game;      //  a reference to the currently running game (Phaser.Game)    this.add;       //  used to add sprites, text, groups, etc (Phaser.GameObjectFactory)    this.camera;    //  a reference to the game camera (Phaser.Camera)    this.cache;     //  the game cache (Phaser.Cache)    this.input;     //  the global input manager. You can access this.input.keyboard, this.input.mouse, as well from it. (Phaser.Input)    this.load;      //  for preloading assets (Phaser.Loader)    this.math;      //  lots of useful common math operations (Phaser.Math)    this.sound;     //  the sound manager - add a sound, play one, set-up markers, etc (Phaser.SoundManager)    this.stage;     //  the game stage (Phaser.Stage)    this.time;      //  the clock (Phaser.Time)    this.tweens;    //  the tween manager (Phaser.TweenManager)    this.state;     //  the state manager (Phaser.StateManager)    this.world;     //  the game world (Phaser.World)    this.particles; //  the particle manager (Phaser.Particles)    this.physics;   //  the physics manager (Phaser.Physics)    this.rnd;       //  the repeatable random number generator (Phaser.RandomDataGenerator)    //  You can use any of these from any function within this State.    //  But do consider them as being 'reserved words', i.e. don't create a property for your own game called "world" or you'll over-write the world reference.};BasicGame.Game.prototype = {    create: function () {        //  Honestly, just about anything could go here. It's YOUR game after all. Eat your heart out!    },    update: function () {        //  Honestly, just about anything could go here. It's YOUR game after all. Eat your heart out!    },    quitGame: function (pointer) {        //  Here you should destroy anything you no longer need.        //  Stop music, delete sprites, purge caches, free resources, all that good stuff.        //  Then let's go back to the main menu.        this.state.start('MainMenu');    }};

Well here es you would expect your game code comes. Your assets were already loaded so you don't need preload method (probably unless there is a reason to do something in preload method here, but there shouldn't be any reason now anymore!) So you set your variables in create, but don't forget you are using methods so you need to prepend every variable, function name, ... with 'this' keyword, therefore you will have in your create function things like this:

create: function () {  this.player_sprite;  this.enemy_sprite;  this.hit_sprite;  this.blood_sprite;  this.player = {    life: true,    way: 49,    trace: 800,    hp: 100,    chakra: 100,    speed: 250,    str: 1300,    stamina: 100,    sh_cap: 35,    name: 'Kakashi'  };//  Continue with retyping your own create function I just used part of your code to show you what to do with it.//  See instead of var I set up vars as properties of Game object in its prototype, this way you can acces your player object in create function as well as in update, or any other function in BasicGame.Game.prototype!!!//  This is really important, any variable or function you need to acces from update method, or any other function you create in this prototype you need to prepend with this. (i.e. this.yourVariable).//  Use var only for variable that are needed ONLY inside create function this way garbage collector will take care of them after switching from create method to update method (what you don't need to use anymore you don't want to keep in memory obviously)}

As last don't forget to add your functions correctly:

create: function () {  this.player_sprite;  this.enemy_sprite;  this.hit_sprite;  this.blood_sprite;  this.player = {    life: true,    way: 49,    trace: 800,    hp: 100,    chakra: 100,    speed: 250,    str: 1300,    stamina: 100,    sh_cap: 35,    name: 'Kakashi'  };},update: function () {},collect: function(sprite, vial) {  vial.kill();  this.heal_fx.play();  if (sprite == this.player_sprite) {    this.player.hp += 10;  } else {    this.enemy.hp += 10;  }  this.refresh_bar();}// This way you add your functions, but don't forget that I retyped this whole thing with this keyword! You can see that accessing yoru functions needs to be prepended with this as well (that's where this.refresh_bar(); came from!).

Don't forget that if you need to call any function or variable you had you need to use this keyword.

 

f/ scorescreen.js

You can add as many states as you want. If you want to have a scorescreen just add another file in a similar way, accessing data between states can be done by storing the data that need to be transfered in a global object, this way you can access them from anywhere.

 

g/ endscreen.js

Maybe you want to have some kind of endscreen after finishig, or whatever!

 

 

Last hint:

Anytime you use this.state.start(stateName) you start the state new, so if you want for example restart your game after the player died you can add a button to your scorescreen which after clicking on starts only your BasicGame.Game state, because your assets were already loaded once, you don't need to go through that again (you don't need to refresh the page everytime you want the player to start the game again!). Or if you want to do it just quickly you can add something similar to this to your BasicGame.Game state:

if (!this.player.life){  this.state.start('Game');}

This way everything is forgotten and you start only your Game state again (therefore your this.player = {..} will be created again, so you don't need to care about resetting all the vars by hand, phaser does it for you ;-).

 

Well you need to play with it a little bit but this is essential to any game you will create, states really help you to maintain everything lively and as you can see just restarting the game after player dies is a simple one line code (well I got it on four lines but you can leave it on one line if yo uwant ;-))!

 

(boot.js and preloader.js have some code in it you might not need, these are just examples from pahsercreators so you can see how to actually do stuff so delete the unnecessary code, don't leave it there!)

 

Was this helpful, I don't think there is any way you can get lost with all the resources you've got but if you still don't get some part just post here again?

Link to comment
Share on other sites

Ok so I made it according to your instructions, and now it have manu screen and it is working.

But I can't debug my code, maybe to many this. in code.

 

Atm problem is with reading from player object like a 

Uncaught TypeError: Cannot read property 'hp' of undefined
      //Health      this.player_hp_bar = this.game.add.text(20, 5, this.player.hp+'% '+'hp', { fontSize: '25px', fill: '#fff' });        this.player_hp_bar.render = function() {        this.player_hp_bar.text = Math.max(this.player.hp, 0) + '% '+'hp';      }
      this.player = {        life: true,        way: 49,        trace: 800,        hp: 100,        chakra: 100,        speed: 250,        str: 1300,        stamina: 100,        sh_cap: 35,        name: 'Kakashi'      };

Both of them are in my 

BasicGame.Game.prototype = {    create: function () {.....

Like on Your example

 

 

Edit:

 

I added this. to Math.max and error HP is gone but now is error with .max ........

ncaught TypeError: Cannot read property 'max' of undefined
      this.player_hp_bar = this.game.add.text(20, 5, this.player.hp+'% '+'hp', { fontSize: '25px', fill: '#fff' });        this.player_hp_bar.render = function() {        this.player_hp_bar.text = this.Math.max(this.player.hp, 0) + '% '+'hp';      }
Link to comment
Share on other sites

If you are going for javascript Math object, then you can't use this keyword, this refers to you current object in this case because there is no Math defined on your this object you get an error. From inside your object you still have access to global scope as in any other javascript object, so use only Math.max.

 

I'm not entirely sure right now, do you still have a problem with accessing your player info or not?

 

Depending where you are accessing it from you can obtain different object under this keyword, for example: var tt = {}; inside functions in tt this keyword refers to object tt, so if you are trying to access it from a different scope where your this keyword references to a different object than your game then you will get an error because yoru another object doesn't have player or hp property. It's always good to check with console.log(this); what you are referencing to with this keyword when you are not sure or when you get an error when everything should work properly to see if you are not referencing a wrong object.

 

Glad you managed to set up your menu!

 

Edit:

Seems like you lost your problem with this.player.hp because browser first encoutners problem with this.Math.max reference so nothing solved yet ;-).

If you are referencing from another object method or something try adding player as an input into a function definition so you can access it from inside, something like this:

update: function() {  test(this.player, this.game);},test: function (player, game) {  player_hp_bar = game.add.text(20, 5, player.hp+'% '+'hp', { fontSize: '25px', fill: '#fff' });   player_hp_bar.render = function() {  player_hp_bar.text = Math.max(player.hp, 0) + '% '+'hp';}

Oh just realised you already have some function there, so just change it a little bit:

this.player_hp_bar = this.game.add.text(20, 5, this.player.hp+'% '+'hp', { fontSize: '25px', fill: '#fff' }); this.player_hp_bar.render = function(player) {this.player_hp_bar.text = Math.max(player.hp, 0) + '% '+'hp';}

And call it with this.player_hp_bar.render(this.player);

 

Check this MDN page on this keyword so you can better understan why you can't use this.player inside a method of a different object.

 

Hope this helps, if not maybe there is a different problem xD.

Link to comment
Share on other sites

That's probably because in javascript you cannot define object with object property, first you need to define an object and then it's properties, i.e.:

// this is correctvar tt = {};tt.hpBar = {};tt.hpBar.hohoho = {};tt.hpBar.hohoho.whatever = 'something';// this is incorrect and results in you error messagevar tt.hpBar.hohoho.whatever = 'something';

Or you are trying to set object property on a string, or something else. Check what kind is your variable which you are trying to give your text property to see it's an object.

 

EDIT:

Inside your function you are referencing in that incorrect way I mentioned above, you'll understand after reading that MDN article for now change it to this:

this.player_hp_bar = this.game.add.text(20, 5, this.player.hp+'% '+'hp', { fontSize: '25px', fill: '#fff' }); this.player_hp_bar.render = function(player) {  this.text = Math.max(player.hp, 0) + '% '+'hp';  // this keyword inside this.player_hp_bar.render references to this.player_hp_bar, so this.text is same as this.player_hp_bar.text but you were adding one more layer to it trying to do this this.player_hp_bar.player_hp_bar.text which is a problem because your this.player_hp_bar doesn't have defined property player_hp_bar in the first place}
Link to comment
Share on other sites

As I mentioned before your last post change your function a little bit and it should be ok.

It's quite often a bag of problems when you are switching gears but once you learn this you can do any other game project this way from the start and you will be facing more pleasant feelings than discomforting ;-).

 

Edit: Well don't forget to always realize what this keyword is referencing to when you use it, it's (not only) a javascript feature so if you are using the language you should learn about it, it's very frequently used! Plus you usually get an error with a line where it is so now it shouldn't be that hard to debug it ;-).

Link to comment
Share on other sites

Ok so it is working now. But I feel there will not be a happy end.

 

Afret You fix this error with object now I get error 

Uncaught TypeError: Cannot read property 'hp' of undefined

This time in line 473 :)

    attack: function(target) {      if (this.target.hp > 0) {        this.target.hp -= this.shuriken_dmg;        this.stab_fx.play();        if (this.target.hp <= 0) {          this.target.life = false;          this.win(target)        }      } else {          this.target.life = false;          this.win(target)      }    },

I think whole code will need to be fixed after migration to 'states' template 

Link to comment
Share on other sites

Well this time the problem is same again ;-).

 

Btw your function is defined as attack: function(target) {..}, then why are you inside referencing as this.target when you have target as an input? Unless it's different you should go with just target because it's your input, so:

attack: function(target) {if (target.hp > 0) {target.hp -= this.shuriken_dmg;this.stab_fx.play();if (target.hp <= 0) {target.life = false;this.win(target)}} else {target.life = false;this.win(target)}},

I don't know which line is 473 so can't help it but the error basically says that you have a problem with your object definition/assignement (the error basically says that this.target is undefined so you need to find out why, maybe you are referencing to an object that actually doesn't exist, so use console.log to see what your problematic object is), same as before ;-).

 

EDIT: First of all after getting this kind of error comment all the code in your problematic function and in the first line type: console.log(yourProblematicObject); where yourProblematicObject is the one your error is referencing to, althought I don't know which line it was you are looking for hp property on your target only so your problem must lie there, therefore check with console.log(target); inside your function what target exactly is and then you can decide where the error came from.

 

I highly advise you to go through that MDN article and learn more about this keyword as well as about defining a new object with properties ^.^

 

EDIT2: Btw you had this.target in your function but you also had only target inside, unless they are different you should definitely unify it (did you forget to change the ones that are in function calls?). Your function attack should be called as: this.attack(this.target); (or someOtherObject.attack(this.target); depending if attack is part of some other object or not)

i.e.

attack: function(target) {
  if (this.target.hp > 0) {
    this.target.hp -= this.shuriken_dmg;
    this.stab_fx.play();
    if (this.target.hp <= 0) {
      this.target.life = false;
     this.win(target)
    }
  } else {
    this.target.life = false;
    this.win(target)
  }
},

Link to comment
Share on other sites

But what do you mean in edit2? 

 

It is working and that's how my code look

    attack: function(target) {      if (target.hp > 0) {        target.hp -= this.shuriken_dmg;        this.stab_fx.play();        if (target.hp <= 0) {          target.life = false;          this.win(target)        }      } else {          target.life = false;          this.win(target)      }    },

But target is from another function

    shurikenCollision: function(sprite, jutsu) {      if (sprite == this.player_sprite) {        this.attack(this.player);        this._blood(sprite, jutsu);      } else if (sprite == this.enemy_sprite) {        this.attack(this.enemy);        this._blood(sprite, jutsu);      } else if (sprite == this.enemy_shurikens || this.shurikens && jutsu == this.enemy_shurikens || this.shurikens) {        this.shu_animation = this.shu_animations.getFirstExists(false);        this.shu_animation.reset()        this.shu_animation.reset(jutsu.body.x + jutsu.body.halfWidth, jutsu.body.y + jutsu.body.halfHeight);        this.shu_animation.alpha = 0.9;        this.shu_animation.play('shu_animation', 30, false, true);        sprite.kill();        jutsu.kill();        this.clashSound();      }       jutsu.kill();      this.refresh_bar();    },

I mean this part 

    shurikenCollision: function(sprite, jutsu) {      if (sprite == this.player_sprite) {        this.attack(this.player);
Link to comment
Share on other sites

Oh I just meant that when you were adding this keyword you added it only at the begging of lines but not inside function calls, that's why I bolded this.target and target, when you were adding this.target you should have added it to that lonesome target in function call as well, therefore this.win(target) should have been this.win(this.target) if you were uniformly adding this keyword after you were introduced to states ;-). But yes correct is without this keyword I just pointed out that you added it somewhere and forgot to add it in some other places. I was just pointing out your nonuniformity nothing else I wasn't commenting the code itself just how you placed this. before some targets and left some of them out xD.

 

And in your best interest I hope you will add Tenten and RockLee! ;-)

Link to comment
Share on other sites

  • 3 years later...
On 7/24/2015 at 5:24 PM, AzraelTycka said:

Go through this, it's the basics about setting up your project with phaser.

 

Otherwise you can check:

 

this one will take you through the whole process of creating the game with states step by step (don't miss this one you can find everything you need in it!!!),

and this one for some basics http://www.gamedevacademy.org/make-a-html5-platformer-with-phaser/

 

Btw did you check the resource folder as I suggested above? You can find the code where you just put yourgame piece by piece, so check it as well!

Thanks for this links ❤️

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...