samid737

Members
  • Content count

    217
  • Joined

  • Last visited

  • Days Won

    1

samid737 last won the day on April 18

samid737 had the most liked content!

2 Followers

About samid737

  • Rank
    Advanced Member
  • Birthday February 12

Contact Methods

  • Website URL
    https://github.com/samid737/

Profile Information

  • Gender
    Male
  • Location
    The Netherlands

Recent Profile Visitors

1,068 profile views
  1. How make an animation play before my character dies

    https://phaser.io/examples/v2/animation/animation-events
  2. Can't play animations

    you can try using input events as an alternative:
  3. Making text show in front of everything else.

    in this order, using latest version? :
  4. The logic looks oke to me. Are you instatiating new objects? I can't find where you are reading property x in the code. Maybe a demo might help. You can use Phaser.Math.clamp to clamp the index value in changeIndex(). Clamp the index between 0 and imageGroup.length for example to avoid out of range index. An applied example:
  5. Issues making my first snake game

    The first bug is is caused by the tail array. When you restart and _generateFood again the first time, the tail.length will be incorrect (if you ate at least one food in the previous turn). When you call _trigger_death(), the game state restarts but tail is not reset (you have to manage that manually in your case). try: function _trigger_death(one, two) { tail=[]; game.state.restart(); } Here is a related topic to deal with this. The second bug is caused by _eat_food() . When the next sprite is added after eating, the nextY and nextX values are calculated incorrectly probably (try 100,100 and it will always spawn at 100,100). A simple way out is to set nextX and nextY to -100 so that you won't see that happening.
  6. You can add the screens/list to some array, then iterate trough that array to check if some condition is met when the mouseWheelCallback is executed: The example can also check if mouse is hovering over some list, see commented code inside scroll().
  7. Facebook Messenger Inspired Basketball game

    Yes. This part deals damage: if (ball && ball.body.velocity.y > 0) { //front_rim = game.add.sprite(148, 182, 'front rim'); //this one if(front_rim==null){ front_rim = game.add.sprite(148, 182, 'front rim'); //patch } ball.body.collides([collisionGroup], hitRim, this); // This can be done in create } Basically everything that has a game.add can be moved to create() in this game. The tweens for example can be paused and played instead of readding them in update. Im not sure why sprites are added in update, you can add them all once during create() and for example toggle their visiblity (emoji.visible=true etc..). I would suggest rebuilding the game from scratch, you will probably have a much better version by going trough the phaser examples.
  8. Compiled html5+Phaser Game slow in android

    The game is not coded well(memory leaks). Maybe submitting an issue to the author of the game will help.
  9. PLAY TESTERS?

    Pretty cool game. But Joof's prices are a bit high (unless you can visit the store every level/area) .
  10. Facebook Messenger Inspired Basketball game

    I remember this had something to do with sprites being added every frame in update when the ball is thrown: For smart phones (and in general), its better to bundle all your images to one texture atlas. You can use TexturePacker to combine all images to one atlas.
  11. You can add the points to an array and iterate trough the array in update. To make the player move again you can use input events: var Xcoordinates=[100,200,340]; var offset=5; var movementKey; function create() { movementKey=game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR); movementKey.onDown.add(walk, game); } function update() { Xcoordinates.forEach(function(xcoord) { if((player.x>(xcoord-offset))&&(player.x<xcoord+offset)) { player.body.velocity.x=0; } }; } function walk() { player.body.velocity.x=200; } input event example: For the vertical bars approach you can use arcade physics and resize the physics body using either sprite scaling or setSize. Then use game.physics.arcade.overlap() to check for overlaps. Again you can use input events to move the object once is has come to a stop.
  12. body.overlapX/overlapY always giving 0 in Phaser?

    Arcade physics bodies are rectangular by default, are you sure their bodies are actually overlapping? You can check with game.debug.body , example:
  13. Should I use onDown here and if so, how?

    You can add the onDown input event in create to run once: https://codepen.io/Samid737/pen/aLdpqa
  14. Play sound when key pressed

    Does this work?: if (this.leftKey.isDown) { if(this.rightKey.isDown) { this.stopFlySound(); this.ghost.body.moves = false; this.ghost.body.velocity.x = 0; this.ghost.body.velocity.y = 0; } else { this.playFlySound(); this.ghost.body.moves = true; this.ghost.body.velocity.x = -120; this.ghost.body.velocity.y = -160; } }