• Content Count

  • Joined

  • Last visited

About elitian

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Awesome answer, just what I was looking for. Concise and clear. Thanks!
  2. Is there a big efficiency difference, in terms of game speed/smoothness and memory usage between using a small png for entities sprites VS using a big png and scaling it down with javascript ingame?
  3. Sorry, didn't offer much information because I thought it was some sort of limitation on IOS system. Found the problem, although can't explain why. This function was messing everything up: animateFontSize:function(text_item_from_all_to_be_animated_text_entities, max_size, min_size, size_change_rate=1) { // add //item[] = true to the create function item = text_item_from_all_to_be_animated_text_entities if( item[1] && item[0].fontSize < max_size) { item[0].fontSize += size_change_rate if(item[0].fontSize == max_size) { item[1] = false } } if(!item[1] && item[0].fontSize > min_size) { item[0].fontSize -= size_change_rate if(item[0].fontSize == min_size) { item[1] = true } } } where text_item_from_all_to_be_animated_text_entities is an array containing arrays of 2 elements: [text bitmaptext objects from Phaser framework, does_text_needs_to_grow]. For some reason this was messing up the game on IOS browser... Don't know why, but all is good now!
  4. Somehow phaser is not loading on IOS, yet loads fine on all else. Don't know what could be causing this, and it happens on multiple projects... What are the differences between IOS and the rest of the devices?
  5. Nvm, just solved it by recognizing whether is mobile or not and then scaling accordingly.
  6. When manipulating sprites, we can do this.sprite.anchor.setTo(.5,.5), which sets the rotation and "origin" of the sprite to its center, rather then the upper left corner. How can we do the same for the game world? So when we spawn a sprite on (0,0), it spawns to the center of the game world/canvas?
  7. I'm making a simple game in phaser ( http://victak.github.io/SuperDuperMegaDeathBird/ ), but am struggling a bit with making it look good on my smartphone (a nexus 5). Thing is, the graphics are pretty crisp and nice on the computer (my screen reso is 1366x768). But in my mobile device, it's not bad, but not crisp as it was intended to be. How can I remedy this issue? I tried increasing the assets png size, doubling it and then using this.objectHere.scale.setTo(a,b) to scale it down, but it still isn't good enough. Increasing x4 and then scaling it down makes it too pixelated (image too big scaling to too small). Do you guys have any advice on how to remedy this problem?
  8. Thanks a lot Milton! Megmut, I know what states are, I asked what the Stage is. But thanks anyway! Maybe you read State instead of Stage? haha, indeed, they are similar words. Thanks.
  9. In this tutorial about game states, there is a part where the author says: this.game.state.start("GameOver",true,false,score); "This is the first time I am calling the state with all its arguments, so let’s have a look at them: GameOver is the name of the state to start. The second argument is called clearWorld, default at true, and clears the World display list fully (but not the Stage, so if you’ve added your own objects to the Stage they will need managing directly)." What is this "Stage" she talks about? And how would I add my "own" objects to this "Stage", in a way that the clearWorld won't clear these objects and I'll have to manage them directly?
  10. I built a simple game using phaser, but didn't use multiple game states. The game had only one screen and no states! It was all poorly done. So now I'm learning game states. In this code snippet, taken from a phaser game https://github.com/alexdantas/ludum-dare-29/blob/master/js/states/play.js, we have, for example, a line consisting of this.game.camera.setBoundsToWorld(). I know how this works, but i'm having trouble knowing who is this here. I know this in OOP refers to the "owner" of the function, but in this case, who is it? Another doubt I'm struggling with is, where does the .game.camera.setBoundsToWorld() comes from? Is it from when Phaser initializes a new state? When it start a new state, does it create a new "main state", which in this case is what the "this" refers to, and add attributes/methods to it? Like this game.camera.setBoundsToWorld() method? function Play() {} Play.prototype = { create: function() { this.game.physics.startSystem(Phaser.Physics.ARCADE); this.game.stage.backgroundColor = '#000'; // initialize game variables this.cash = 0; this.chunkGroup = this.game.add.group(); this.nextChunkY = 0; this.game.world.bounds.x = 0; this.game.world.bounds.height = 1024; this.game.camera.setBoundsToWorld(); this.lastChunkIndex = 0; this.tephra = this.game.add.group(); this.rocks = this.game.add.group(); this.gems = this.game.add.group(); this.carrots = this.game.add.group(); this.lastChunk = null; this.chunkIndex = 0; this.generateChunk(); this.generateChunk(); }, }