Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Hey Yal, nearly got it all figured out. I was trying to make some of the walls more rectangular and less squared. I used the below to do so in the draw event and it looks perfect. However, the collision box is still the full square. I made sure to also change the tops and bottoms.


draw_set_color(c_gray)
d3d_draw_floor(x   ,y+32 ,     zbottom+0.01,x + sprite_width,y + sprite_height,zbottom+0.01,my_fex,image_xscale,image_yscale)//Floor
draw_set_color(c_white)
d3d_draw_floor(x    ,y+32,     ztop-0.01   ,x + sprite_width,y + sprite_height,ztop-0.01,my_fex,image_xscale,image_yscale)//Ceiling
d3d_draw_wall(x ,y+32  ,zbottom+0.01,x + sprite_width,y+32     ,ztop-0.01,my_wex,image_xscale,1)//Back wall
d3d_draw_wall(x   ,y   + sprite_height,zbottom+0.01,x    ,y+32,ztop-0.01,my_wex,image_yscale,1)//Left
d3d_draw_wall(x + sprite_width,y+32,zbottom+0.01,x + sprite_width,y  + sprite_height,ztop-0.01,my_wex,image_yscale,1)//Right
d3d_draw_wall(x + sprite_width   ,y + sprite_height,zbottom+0.01,x,y + sprite_height,ztop-0.01,my_wex,image_xscale,1)//Front?

(+1)

Yeah, the collision code first does a standard Game Maker collision and then does a Z collision check (using a per-instance collision function to allow for things like slopes) to see if the overlapping objects are colliding vertically as well... so the collision mask of the terrain object's sprite is used for the XY collision check regardless of what you draw. If you make the walls more narrow than the sprite, you should change the collision mask to match this (either by giving the walls a new sprite, or changing the existing sprite's collision mask to not cover the entire sprite).

(+1)

Perfect, thank you!