The VG Resource
G33X (Sketchasaur's sprites n' things) - Printable Version

+- The VG Resource (https://www.vg-resource.com)
+-- Forum: Archive (https://www.vg-resource.com/forum-65.html)
+--- Forum: July 2014 Archive (https://www.vg-resource.com/forum-139.html)
+---- Forum: Creative Zone (https://www.vg-resource.com/forum-86.html)
+----- Forum: Spriting and Pixel Art (https://www.vg-resource.com/forum-14.html)
+----- Thread: G33X (Sketchasaur's sprites n' things) (/thread-23565.html)

Pages: 1 2 3 4 5 6


RE: G33X (Sketchasaur's sprites n' things) - Lexou Duck - 07-01-2014

Quote:Nice Lexou and Sketchasaurus. Sorry this is a bit off topic but how did you handle coding the layering/depth correctly?

good question kiddo

what i did was i made the player and enemy classes have, more than just x and y coordinates of where they are on screen, a z coordinate, which represents altitude
the idea is that the game does all the calculations of walking and shit without taking z into account
and at the end right before your draw the sprite onscreen, you do y = y +z so that they're drawn at the height needed
also this way i can just do stuff with z to make him jump how i feel

for the shadow that stays on ground just don't incorporate z
and for the layering, what works is doing
if (player.y + player.z < enemy.y + enemy.z)
add(player);
add(_enemy);
if (player.y + player.z > enemy.y + enemy.z)
add(enemy);
add(player);
add means to add the sprite into the sprite drawer class thingy, here in the correct order


aaand here's some progress, did the hops on the knael character, and fully programmed the HUD
[Image: kmdrT8G.gif]
(its choppy because gifcam, dont worry the game runs better irl)


RE: G33X (Sketchasaur's sprites n' things) - Kelvin - 07-03-2014

You actually change the height to y+z? Why not just make your draw coordinates (x, y+z) so the y value can remain the same?


RE: G33X (Sketchasaur's sprites n' things) - Lexou Duck - 07-03-2014

(07-03-2014, 06:49 AM)Midi Wrote: You actually change the height to y+z? Why not just make your draw coordinates (x, y+z) so the y value can remain the same?

because the y coordinate is inherently used by the library to draw the sprites
and no, the draw function take no arguments, it just draws the sprite you want at the coordinates set by its own this.x and this.y variables

this library (haxeflixel) is a little bit restrictive on things like this but it has so much done right though


RE: G33X (Sketchasaur's sprites n' things) - Kelvin - 07-03-2014

That's a dumb and utterly unnecessary restriction. It doesn't have a function to draw a piece of an image directly?


RE: G33X (Sketchasaur's sprites n' things) - Lexou Duck - 07-03-2014

[Image: 4BZLto2.gif]

ok so there's the player/enemy collisions, with altitude in mind yet again
also the arena border collisions those weren't there before
the hurt animation (i can always make it shorter or longer or stuff, it works is all)
i did the name showing on the HUD btw (i lied in the last post i hadn't done that yet)
and probably lots of other small stuff here and there

see them fast updates man ?


ps: yes you can easily choose your character, same goes for the enemy
the reason i keep showing you guys kamekannon is because i love his smug face okay


RE: G33X (Sketchasaur's sprites n' things) - Koh - 07-03-2014

Looks good! Love the damage expressionism too~ Care to share how you record GIFs though? What in the world program do I need to go download (or pirate) for such a thing?