• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM Game stopped drawing walls for some reason

I

InfantRegalia

Guest
Hey guys! I'm really new here, and in programming in general. So a few days ago I started making a Wizardry-type first person dungeon with walls, doors and all the good stuff. It worked like I was planning for it to work. The character was walking around wall or door or other objects, and the wall or door or other sprites were drawing accordingly to where my character was, using code like the one I pasted below (this is just an example, I actually did one for each of the four possible image angles 0, 90, 180, 270). But now, suddenly, the objects don't draw sprites anymore! The game starts up and I don't see my sprites, unless I spin my character a lot, then the game draws a few of the walls for some reason... But a few days ago if my player object stood in front of the wall, the wall sprite was drawn perfectly onto the screen! But now there's nothing! What's happening? What should I do? This is not THAT important, more of a learning exercise, and I know the code is really, really noobish, but it's so simple it can't even have errors! At least I think so... But still, my walls don't draw no more! Here's the full project, I doubt I can post so much code on the forum, so I just uploaded the whole thing. Thanks in advance! Although I say it's not very important, it's actually is. Ever since Wizardry 6 Bane of the Cosmic Forge came out in 1990, I had this dream to make a 1st person Dungeon Crawler about a golden baby-child, and now I almost figured out the dungeon drawing part, and it just busted on me! Stopped working after 3 blissful days of complete success. Thanks guys! THE LINK TO GMX ARJ: https://uploadfiles.io/06c3838


Also here are screenshots of What I mean. I get it a lot that my english is not too good, so maybe visual aid will help a bit. Sorry guys.

P.S. It is not in my understanding of honor to ask anyone to blatantly make the walls draw, but if You can please point me into the direction of the problem. I will do myself the best to read this webzone and get the knowledge needed to improve. Now I just don't have any good idea of why my walls went bananas.




Code:
//5
if image_angle = 0 && !place_meeting(player.x+16, player.y+4, ParentBoy)
then
if place_meeting(player.x+16, player.y+4, wall)
draw_sprite(rw5,0,0,0);
else
if place_meeting(player.x+16, player.y+4, door)
draw_sprite(rdc5,0,0,0);
else if place_meeting(player.x+16, player.y+4, doo)
draw_sprite(rdo5,0,0,0);

if image_angle = 0 && !place_meeting(player.x+16, player.y-4, ParentBoy)
then
if place_meeting(player.x+16, player.y-4, wall)
draw_sprite(lw5,0,0,0);
else
if place_meeting(player.x+16, player.y-4, door)
draw_sprite(ldc5,0,0,0);
else if place_meeting(player.x+16, player.y-4, doo)
draw_sprite(ldo5,0,0,0);

if image_angle = 0 && !place_meeting(player.x+18, player.y, ParentBoy)
then
if place_meeting(player.x+18, player.y, wall)
draw_sprite(mw8,0,0,0);
else
if place_meeting(player.x+18, player.y, door)
draw_sprite(mdc8,0,0,0);
else if place_meeting(player.x+18, player.y, doo)
draw_sprite(mdo8,0,0,0);

//4
if image_angle = 0 && !place_meeting(player.x+12, player.y+4, ParentBoy)
then
if place_meeting(player.x+12, player.y+4, wall)
draw_sprite(rw4,0,0,0);
else
if place_meeting(player.x+12, player.y+4, door)
draw_sprite(rdc4,0,0,0);
else if place_meeting(player.x+12, player.y+4, doo)
draw_sprite(rdo4,0,0,0);


if image_angle = 0 && !place_meeting(player.x+12, player.y-4, ParentBoy)
then
if place_meeting(player.x+12, player.y-4, wall)
draw_sprite(lw4,0,0,0);
else
if place_meeting(player.x+12, player.y-4, door)
draw_sprite(ldc4,0,0,0);
else if place_meeting(player.x+12, player.y-4, doo)
draw_sprite(ldo4,0,0,0);

if image_angle = 0 && !place_meeting(player.x+16, player.y, ParentBoy)
then
if place_meeting(player.x+16, player.y, wall)
draw_sprite(mw5,0,0,0);
else
if place_meeting(player.x+16, player.y, door)
draw_sprite(mdc5,0,0,0);
else if place_meeting(player.x+16, player.y, doo)
draw_sprite(mdo5,0,0,0);

//3

if image_angle = 0 && !place_meeting(player.x+8, player.y+4, ParentBoy)
then
if place_meeting(player.x+8, player.y+4, wall)
draw_sprite(rw3,0,0,0);
else
if place_meeting(player.x+8, player.y+4, door)
draw_sprite(rdc3,0,0,0);
else if place_meeting(player.x+8, player.y+4, doo)
draw_sprite(rdo3,0,0,0);

if image_angle = 0 && !place_meeting(player.x+8, player.y-4, ParentBoy)
then
if place_meeting(player.x+8, player.y-4, wall)
draw_sprite(lw3,0,0,0);
else
if place_meeting(player.x+8, player.y-4, door)
draw_sprite(ldc3,0,0,0);
else if place_meeting(player.x+8, player.y-4, doo)
draw_sprite(ldo3,0,0,0);

if image_angle = 0 && !place_meeting(player.x+12, player.y, ParentBoy)
then
if place_meeting(player.x+12, player.y, wall)
draw_sprite(mw4,0,0,0)
else
if place_meeting(player.x+12, player.y, door)
draw_sprite(mdc4,0,0,0);
else if place_meeting(player.x+12, player.y, doo)
draw_sprite(mdo4,0,0,0)

//2

if image_angle = 0 && !place_meeting(player.x+4, player.y+4, ParentBoy)
then
if place_meeting(player.x+4, player.y+4, wall)
draw_sprite(rw2,0,0,0);
else
if place_meeting(player.x+4, player.y+4, door)
draw_sprite(rdc2,0,0,0);
else if place_meeting(player.x+4, player.y+4, doo)
draw_sprite(rdo2,0,0,0);




if image_angle = 0 && !place_meeting(player.x+4, player.y-4, ParentBoy)
then
if place_meeting(player.x+4, player.y-4, wall)
draw_sprite(lw2,0,0,0);
else
if place_meeting(player.x+4, player.y+4, door)
draw_sprite(ldc2,0,0,0);
else if place_meeting(player.x+4, player.y-4, doo)
draw_sprite(ldo2,0,0,0);


if image_angle = 0 && !place_meeting(player.x+8, player.y, ParentBoy)
then
if place_meeting(player.x+8, player.y, wall)
draw_sprite(mw3,0,0,0);
else
if place_meeting(player.x+8, player.y, door)
draw_sprite(mdc3,0,0,0);
else if place_meeting(player.x+8, player.y, doo)
draw_sprite(mdo3,0,0,0);


//1
if image_angle = 0 && !place_meeting(player.x, player.y+4, ParentBoy)
then
if place_meeting(player.x, player.y+4, wall)
draw_sprite(rw1,0,0,0);
else
if place_meeting(player.x, player.y+4, door)
draw_sprite(rdc1,0,0,0);
else if place_meeting(player.x, player.y+4, doo)
draw_sprite(rdo1,0,0,0);

if image_angle = 0 && !place_meeting(player.x, player.y-4, ParentBoy)
then
if place_meeting(player.x, player.y-4, wall)
draw_sprite(lw1,0,0,0)
else
if place_meeting(player.x, player.y+4, door)
draw_sprite(ldc1,0,0,0);
else if place_meeting(player.x, player.y-4, doo)
draw_sprite(ldo1,0,0,0)

if image_angle = 0 && !place_meeting(player.x+4, player.y, ParentBoy)
then
if place_meeting(player.x+4, player.y, wall)
draw_sprite(mw2,0,0,0);
else
if place_meeting(player.x+4, player.y, door)
draw_sprite(mdc2,0,0,0);
else if place_meeting(player.x+4, player.y, doo)
draw_sprite(mdo2,0,0,0);
 
Last edited by a moderator:

Llama_Code

Member
I don't have time to look at this now, but 2 simple things come to mind,

If you have code in the walls draw event, make sure you put draw_self() at the very top, otherwise it will not draw the sprite assigned.

Also you can try clearing the cache by clicking the little broom icon at the top of the status bar in the GMS IDE, that can cause all kinds of funky issues after many changes and test runs.
 
I

InfantRegalia

Guest
I don't have time to look at this now, but 2 simple things come to mind,

If you have code in the walls draw event, make sure you put draw_self() at the very top, otherwise it will not draw the sprite assigned.

Also you can try clearing the cache by clicking the little broom icon at the top of the status bar in the GMS IDE, that can cause all kinds of funky issues after many changes and test runs.
Hey! Thanks, but the issue is not with the wall object sprites. They're fine. The problem is with the sprites that are supposed to be drawn on the screen when the player object gets near a wall object.
 
Top