Users browsing this thread: 3 Guest(s)
G33X (Sketchasaur's sprites n' things)
#76
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)
[Image: E3DU8rS.png]
Reference
♥ ♥ ♥ LOVE ♥ ♥ ♥
Omega ; Phant Mmkay ; Baegal ; Gorsal ; Drakocat ; Chaoxys ; TomGuyCott ; Chris2balls ; Mighty Jetters ; Blueblur97 ; NICKtendo DS ;
Kachua (Secret Santa) ; and some more that i need to locate, save and link onto here
#77
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?
Thanked by:
#78
(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
[Image: E3DU8rS.png]
Reference
♥ ♥ ♥ LOVE ♥ ♥ ♥
Omega ; Phant Mmkay ; Baegal ; Gorsal ; Drakocat ; Chaoxys ; TomGuyCott ; Chris2balls ; Mighty Jetters ; Blueblur97 ; NICKtendo DS ;
Kachua (Secret Santa) ; and some more that i need to locate, save and link onto here
Thanked by:
#79
That's a dumb and utterly unnecessary restriction. It doesn't have a function to draw a piece of an image directly?
Thanked by:
#80
[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
[Image: E3DU8rS.png]
Reference
♥ ♥ ♥ LOVE ♥ ♥ ♥
Omega ; Phant Mmkay ; Baegal ; Gorsal ; Drakocat ; Chaoxys ; TomGuyCott ; Chris2balls ; Mighty Jetters ; Blueblur97 ; NICKtendo DS ;
Kachua (Secret Santa) ; and some more that i need to locate, save and link onto here
#81
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?
[Image: tamerkoh.gif?9][Image: DevBanner.png][Image: Youtube.gif]DLBROOKS33
Thanked by:


Forum Jump: