Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Hey Yal. I'm back again, I am so so sorry for disturbing you but I got this thing bugging me and I can't figure it out. Basically, when my player object is beneath objects, it draws the head on the very top layer (I assume as part of how they are drawn in tall grass?) only problem is, I can't find where this is set to draw as the draw event contains only, as far as I can tell, the general drawing of the player sprite. I was figuring if I could locate the code that draws the head separately, I could add a:

if (place_meeting(x,y,obj_tallgrass_32) or place_meeting(x,y,obj_tallgrass_64) {

(the code that draws the head here)

}

so that when the player is below something say, a bridge on a higher layer, you don't see the head of the player. fake 3d, if you will!

Any help would be great, and hopefully it's not something obvious I've missed like a real dumbo the elephant.

Cheers Gov.

here's a pic, for clarity and what nots.

(+1)

Yeah, there's a reason why you find no special code for this in the player object: it's actually the grass that handles it. Basically, the grass is in front of the player normally, but each grass object draws the top of the player after drawing itself if the player currently is colliding with it. (Basically, I use the "painter's algorithm" to make part of the player be above the grass... by just drawing it on top of the grass)

(For some reason I use dynamic rendering masks for this - I just realized that just drawing the upper half of the player's sprite with draw_sprite_part would've probably done the same thing but with much simpler code... x3)

(+1)

On closer inspection, I just realized that this is a bug! The grass' drawing code uses || instead of && when doing the collision check, so essentially the player's status will always count as "in my particular patch of grass" and trigger the additional head drawing. Changing the the collision check ||s to && in obj_tallgrass_32's draw event (lines 13-16) should fix this. (obj_tallgrass_64 inherits everything from _32 so you shouldn't need to change that)

(+1)

Thanks again :) and woo hoo! My idiocy was useful!

(+1)

Fixed version is up! Thanks for the involuntary debug testing :3