Users browsing this thread: 1 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


Messages In This Thread
RE: Nes-asaurus' spritestuffs - by ##SKELETON## - 08-02-2013, 08:18 AM
RE: " Nes-asaurus' " spritestuffs - by MotorRoach - 09-11-2013, 01:48 PM
RE: " Nes-asaurus' " spritestuffs - by Gors - 10-01-2013, 05:58 AM
RE: " Nes-asaurus' " spritestuffs - by Gors - 10-01-2013, 06:55 AM
RE: " Nes-asaurus' " spritestuffs - by Sengir - 10-01-2013, 11:58 AM
RE: Sketchasaur's Sprite-toons - by KevinTriebel - 10-03-2013, 10:01 AM
RE: Sketchasaur's Sprite-toons - by Koopaul - 10-04-2013, 10:32 AM
RE: Sketchasaur's Sprite-toons - by Sengir - 10-04-2013, 11:14 AM
RE: Sketchasaur's Sprite-toons - by Sketchasaurus - 10-05-2013, 06:25 PM
RE: Sketchasaur's Sprite-toons - by E-Man - 10-05-2013, 09:04 PM
RE: Sketchasaur's Sprite-toons - by E-Man - 10-04-2013, 02:41 PM
RE: Sketchasaur's Sprite-toons - by Virt - 10-04-2013, 02:55 PM
RE: Sketchasaur's Sprite-toons - by Sketchasaurus - 10-07-2013, 11:16 PM
RE: Sketchasaur's Sprite-toons - by Sketchasaurus - 12-03-2013, 08:08 PM
RE: Sketchasaur's Sprite-toons - by Virtuaboy123 - 12-03-2013, 11:36 PM
RE: Sketchasaur's Sprite-toons - by Kelvin - 12-04-2013, 10:08 AM
RE: Sketchasaur's Sprite-toons - by Sketchasaurus - 12-04-2013, 03:33 PM
RE: Sketchasaur's Sprite-toons - by E-Man - 12-04-2013, 05:57 PM
RE: Sketchasaur's Sprite-toons - by Sketchasaurus - 12-04-2013, 08:01 PM
RE: Sketchasaur's Sprite-toons - by Sketchasaurus - 12-08-2013, 03:22 AM
RE: G33X (Sketchasaur's sprites n' things) - by Lexou Duck - 07-01-2014, 09:29 PM

Forum Jump: