khleug35

Members
  • Content count

    5
  • Joined

  • Last visited

  1. OH!!!!!Super Many Thanks Great !!! It Work for me !!!!!!!! Thanks!! magig!!!!!!!!!! Thx for your link!!!! My problem is solved!!!!!!
  2. Thank you very much!!!!!!!!nice
  3. Thank you very much!!!!!!!!nice
  4. Hello everyone, I am developing a platform game like Super Mario style. I try to build a lives list system. like the photo that named "full_lives.PNG." i use this code to make the lives group (number of heart's icon)display on screen. //list the lives icon(number of heart's icon) on screen lives = game.add.group(); lives.fixedToCamera = true; for (var i = 0; i < player_health; i++) { //player_health = 12; lives.create(300 - (i * 30), 0, 'live'); } When enemy collide the player or player get hurt, it remove one live in lives group and remove one heart's icon from screen // When enemy collide the player or player get hurt, it remove one live in lives group and remove one heart's icon from screen var reduce_heart = lives.getFirstAlive(); player_health = player_health -1; if (reduce_heart) { reduce_heart.kill(); } when the player heal his life, the lives will increase one live in lives group and one heart's icon from screen. //when the player heal his life, the lives will increase one live in lives group and one heart's icon from screen. var increase_heart = lives.getFirstExists(false); player_health = player_health +1; if (increase_heart) { increase_heart.revive(); } Here is my Problem, The heart's icon is increase in the lives list last position, you can see the photo that named "increase_health_icon.PNG". var increase_heart = lives.getFirstExists(false); player_health = player_health +1; if (increase_heart) { increase_heart.revive(); } This code is revive the first remove heart's icon, but I hope it can revive heart's icon reverse, How to do it??? thank you very much. I am sorry about my poor English , sorry
  5. Hello everyone, I am developing a platform game like super Mario , I hope the enemy can move left and right horizontal and loop this. I just use very stupid way to make it. I use this code is work. if (enemy.x<= 450){ enemy.body.velocity.x = +200; } else if (enemy.x>= 800){ enemy.body.velocity.x = -200; } if I have more than one enemy, I need to set each of their values. I try to use game.add.tween eg game.add.tween(enemy).to({ x: enemy.x+80 }........, It also work!!!!!!! but same problem , I need to set each of their values. I try to use time.events, but no success. What are the easy way to set enemy auto move left and right horizontal and loop this? Thanks you very much.