Jump to content

ctmartinez1992

Members
  • Posts

    50
  • Joined

  • Last visited

About ctmartinez1992

  • Birthday 07/25/1992

Profile Information

  • Gender
    Male
  • Location
    Portugal
  • Interests
    Fookin metal, technology!!!

Recent Profile Visitors

974 profile views

ctmartinez1992's Achievements

  1. You would think so, but changing that property does nothing. I tried put it before starting the emitter, after starting the emitter, on the update, nothing works. I can't find anything relevant on the source code and looking at my code. This is the only time i use gravity parameters and as soon as i comment the arcade gravity line, it works just fine.
  2. Hi, i have this code that i straight up copied from the the phaser examples: //Rain this.emitter = game.add.emitter(400, 0, 400); this.emitter.width = this.game.width; this.emitter.makeParticles('rain'); this.emitter.minParticleScale = 0.1; this.emitter.maxParticleScale = 0.5; this.emitter.setYSpeed(300, 500); this.emitter.setXSpeed(-5, 5); this.emitter.minRotation = 0; this.emitter.maxRotation = 0; this.emitter.start(false, 1600, 5, 0); //Arcade physics this.game.physics.arcade.gravity.y = GRAVITY;Basically, it's just simulating rain. However, it seems that the arcade gravity is also applied to the emitter because if i comment the gravity line, the rain works fine. I can't seem to find a way to apply a custom gravity to rain. Is there any solution? Thanks in advance.
  3. Or you're correct and i'm a dumbass because i forgot that he is doing inheritance Carry on...
  4. You are correct, kill() only changes some variables to "kill" the sprite out of the game and does not remove from memory but, i don't think there is enough information in the original post for me to jump to a conclusion. You can post more information (code, debug screens, better explanation of your code); you can debug deeper into phaser; or you can use groups and recycle sprites using the combo kill()/revive() Sorry if that doesn't help you much but it's what i can do with what you posted and my current knowledge of Phaser. Best of lucks!
  5. Cool, that's a lot of stuff
  6. I'm almost positive that you can do this: button.addChild(text); //Appends the text as a child of the buttonbutton.getChildAt(0); //Obtains the child in position 0 of the buttonThis seems to be what you're trying to accomplish and you don't need the group
  7. Oh, he actually has that in the code? I assumed it was to show that the rest of the code was irrelevant
  8. How about killing the sprite, you can try with that, not quite the same thing if i'm not mistaken but, it might be a solution. gem.gem.kill();
  9. I'm not sure if the way you did is an alternative to what i do but, to add a sprite i do like thus: game.add.sprite(110, 350, 'lizard');The way you're doing might work but i have never seen anyone do it like that.
  10. On the render function, try to call game.debug.body(spritename);
  11. I would like to have something to show but, i have never found anything too much complex. One of this days i swear to god i'll right one and be done with it. For the time being you can make some simple, not too complex, menus with tweens and Phaser.Button
  12. Wow, 1 year of phaser, let's hope it goes for another year.
  13. Made a simple Fade Out Fade In State transition method or, how i llke to call it FOFIST! Put this code in a separate file and call it something like Fade.js function Fade() { }/*** @parameter {nextState} - String - The state you want to move on to* @parameter {time} - Integer - (OPTIONAL) time it takes to make said transition*/Fade.fadeOut = function(nextState, time) { this.nextState = nextState; this.time = (time === 'undefined') ? 500 : time; var bg = game.add.graphics(0, 0); bg.beginFill('#000000', 1); bg.drawRect(0, 0, game.width, game.height); bg.alpha = 0; bg.endFill(); var tween = game.add.tween(bg); tween.to({ alpha: 1 }, this.time, Phaser.Easing.Linear.None); tween.onComplete.add( function() { game.state.start(this.nextState); var bg2 = game.add.graphics(0, 0); bg2.beginFill('#000000', 1); bg2.drawRect(0, 0, game.width, game.height); bg2.alpha = 1; bg2.endFill(); return game.add.tween(bg2).to({ alpha: 0 }, this.time, Phaser.Easing.Linear.None); }, this); tween.start();};And then you can simply call it with Fade.fadeOut('Nameofthestate');Hope i could help!! P.S. I would like to make something more elaborate that would allow you to change colors but, i can't seem to find a way to change colors without having to use the debug
  14. That is phenomenal, excellent read... You know what's funny, i never had this problem on older games i made where i had the same combination of keys and i didn't had this problem but suddenly, i can't do it on this game or other games. Do you think that it might be a driver problem instead?
×
×
  • Create New...