• Content Count

  • Joined

  • Last visited

Everything posted by vsudakov

  1. I have also faced the same issue, it appears that chrome had issues with settimeout in crosswalk implementation and touch events (settimeout was delayed for the period of the touchstart), so I changed my main game loop from settimeout to use pixi ticker and now crosswalk view works without issues.
  2. Hey guys, please advise me the algorithm for smooth snake animation in a title game. What I have: I have a snake grid-based game, the game core is separated from animation, so first I update snake coordinates, and then making interpolation and update visual representation. For now, I have one circle sprite for one tile. What is the issue: Although animation looks smooth, I would like to make my snake more realistic, which means I don't like my snake made from circles, but I would like to have a head which could turn, body parts and a tail and I would like all of this to be smooth. What have I tried: 1. I tried to use different snake part sprites. I cannot make a smooth animation if I just apply different sprites like "body straight", "body turned 90 degrees", "head", "tail"; I can only apply these for a step animation which is not smooth of course. 2. I created a bunch of circle sprites which follow the head and move the head sprite only, other sprites following each other. It created a smooth movement and it made the snake look like one whole snake and it handled turns perfectly, but when there are any lags in animation, there is a hole in snake because head moves too far and next sprite skips a lot too Can you please point me in the right direction, I would like to create something like this and the main issue right now that I don't know how to rotate sprites properly so they look like a whole snake and avoid this issue with a "hole in snake". Thanks, guys!
  3. Hey guys, Sorry if it is trivial stuff, but I have not found any solution to this issue anywhere. What I have: I have a snake grid-based game with enemies which could move as well. Snake speed can vary and it could move faster or slower, as well as the enemies speed. The animation is independent of the rest of the game, so I just move snake and enemies every N ms one tile and then redraw their positions. What is the issue: This animation does not provide smooth snake movement, because it moves by tiles (120px) and I am struggling to make a smooth snake and enemies movement. What have I tried: I tried to move enemy and snake every 30 frames and then make a tween animation with 30 frames delay to the destination enemy/snake x/y coordinates. When the snake moved faster, I waited 20 frames. This solution is really ugly and if frames drop occurs, the whole game starts to freeze. Also, different fps provide different game speed. Please advise me how I can achieve the smooth movement, I want to have the animation independent of the main game loop which moves everything by tiles, and I want to have the ability to increase/decrease the speed of snake and enemies. Thanks!