ruslanfan Posted November 18, 2018 Share Posted November 18, 2018 Hello everyone! I am working on a game for two players. Mechanic is simple, players starting from center and move to opposite direction by hitting left or right arrow button. The winner is who first will reached edge of screen. Here is working demo Yeah, visually game is far away from nice and cool, but i think i am in right direction. I will try to not forget to write posts in this topic. ? Today i kinda proud of myself for this "for loop" because it's short and smart ha-ha for(i=0;i<move.length;i++){ for(k=0;k<move.children[i].length;k++){ game.add.tween(move.children[i].children[k]).to({ x:width/2, y:height/2, width:0, height:0 }, game.rnd.integerInRange(1000,5000), ease, true); } } Just look at this before and after: dude78 1 Quote Link to comment Share on other sites More sharing options...
aaryte Posted November 18, 2018 Share Posted November 18, 2018 That's a nice simple game. Good work on that nested FOR loop. I like the wild ending. It might be more fun with sound effects! Quote Link to comment Share on other sites More sharing options...
ruslanfan Posted November 21, 2018 Author Share Posted November 21, 2018 Another successful day Animations of dots when player is halfaway from center, was running every time when i press button aand its lack of performance. Everything was soo slow. Triger for animation in "if statement" but must be running only once time. I found this clever solution ? Yep, whole day Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.