Raicuparta Posted August 16, 2015 Share Posted August 16, 2015 Here is my game: Curvatron.In that version (a bit outdated now) the snake's tail is drawn using a Bitmap Data. Every frame, it draws a sprite (small circle) under the snake's head, and erases the end of the tail with a clearRect. This is ugly but it was the fastest method I could find at the time, for mobile. I have been trying to find other ways to do this so that I can have a prettier version on PC, but I'm not sure which one is the best. I tried:Using Graphics, drawing the entire body with a thick line. The entire line is erased and then redrawn every frame. Same thing as 1, but with Bitmap Data. Using Bitmap Data, drawing small circles (not sprites) for each body point, for the entire body. The entire thing is erased with a clearRect every frame and then redrawn.Which one of these approaches is the best? Should I just stick to the original one? Another question: is there much of a performance difference between using a small sprite (16*16) for drawing in the BMD and drawing a circle with the same dimensions? WombatTurkey 1 Link to comment Share on other sites More sharing options...
Ergwun Posted October 17, 2015 Share Posted October 17, 2015 Did you find out the answer to your question? I'd be interested to see the results of any profiling you have done. Also, nice game! Link to comment Share on other sites More sharing options...
Raicuparta Posted October 19, 2015 Author Share Posted October 19, 2015 Did you find out the answer to your question? I'd be interested to see the results of any profiling you have done. Also, nice game!Using method 2 right now. Never really got any help on this, had to just test a bunch of different ways. There are a lot of drawbacks to doing it this way, but it's the only way that doesn't completely butcher performance. Link to comment Share on other sites More sharing options...
WombatTurkey Posted October 19, 2015 Share Posted October 19, 2015 No idea but this game is amazing bro. Cannot wait to play it on my tablet in bed tonight. Link to comment Share on other sites More sharing options...
Raicuparta Posted October 19, 2015 Author Share Posted October 19, 2015 No idea but this game is amazing bro. Cannot wait to play it on my tablet in bed tonight.Oh, thanks. You can also look it up on the Android Play Store or the iOS App Store, it's free. Link to comment Share on other sites More sharing options...
WombatTurkey Posted October 19, 2015 Share Posted October 19, 2015 Oh, thanks. You can also look it up on the Android Play Store or the iOS App Store, it's free. You did a very good job. The only small improvement I have is the edge of lines have a tiny, and I mean tiny bit of pixelation going on. See how the edges are not quite as smooth? Maybe this is only noticeable on my big 25 inch monitor But, it's still fun as hell and you did a great job. Another improvement (not sure if it's possible) but to increase the curvature. It seems like the curvatures are fixed at certain angles. Maybe allow for a more free curvy approach if you will. (If that makes sense) I checked my dev console tab and didn't see the multiplayer mode is connected with node or the ws module. I think you should add that, playing with another person via websockets would be awesome. Link to comment Share on other sites More sharing options...
Raicuparta Posted October 19, 2015 Author Share Posted October 19, 2015 I am working on a new version of the game to publish in Steam. The new version looks much better and you won't notice any aliasing on resolutions up to 1080p! That actually is relevant to this thread, as if I remember correctly it only happens when I try to draw lots of sprites on the BMD. And about the multiplayer, I'm very interested in implementing online multiplayer in the future, but there's still a lot to be done before I even start looking into that. WombatTurkey 1 Link to comment Share on other sites More sharing options...
drhayes Posted October 19, 2015 Share Posted October 19, 2015 Just popped in to say, "Awesome game!" I got addicted to the Android version a while back. I'd think that drawImage'ing an image would be faster than drawing a new circle each time but I'm ready to be surprised, especially on mobile. Link to comment Share on other sites More sharing options...
charlieRobinson Posted November 18, 2016 Share Posted November 18, 2016 Fun game. Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts