• 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 Grass Block Problem

B

Ben Hubble

Guest
Capture.PNG Capture 1.PNG
Hello, i'm currently making a Terraria style game, but i'm having trouble having the grass blocks configure themselves correctly. I've got a spr_soil, which has 6 subimages (I'll show some pictures), but i'm only having trouble with 5 and 6. The objects that are circled should have the subimage of the number inside them, but instead they have image 0 (plain dirt). The code that determines what subimage they will be is this (In the create event for now):
Code:
///Choose What Subimage To Be
image_speed = 0;

if(place_meeting(x,y - 32,obj_soil))&&(place_meeting(x - 32,y,obj_soil))||(place_meeting(x,y - 32,obj_soil))&&(place_meeting(x + 32,y,obj_soil)) {
  image_index = 0; 
}else if(!place_meeting(x - 32,y,obj_soil))&&(!place_meeting(x + 32,y,obj_soil))&&(!place_meeting(x,y - 32,obj_soil)) { 
  image_index = 2;
}else if(place_meeting(x - 32,y,obj_soil))&&(place_meeting(x + 32,y,obj_soil))&&(!place_meeting(x,y - 32,obj_soil)) {
  image_index = 1;
}else if(!place_meeting(x - 32,y,obj_soil))&&(place_meeting(x + 32,y,obj_soil))&&(!place_meeting(x,y - 32,obj_soil)) {
  image_index = 3;
}else if(!place_meeting(x + 32,y,obj_soil))&&(place_meeting(x - 32,y,obj_soil))&&(!place_meeting(x,y - 32,obj_soil)) {
  image_index = 4;
}else if(!place_meeting(x - 32,y,obj_soil))&&(place_meeting(x + 32,y,obj_soil))&&(place_meeting(x,y - 32,obj_soil)) {
  image_index = 5;
}else if(!place_meeting(x + 32,y,obj_soil))&&(place_meeting(x - 32,y,obj_soil))&&(place_meeting(x,y - 32,obj_soil)) {
  image_index = 6;
}
Although it's nothing serious, i'd like this to get fixed because it is more visually pleasing that way, any help would be appreciated!
 
M

maartenvt

Guest
The condition of your first if statement is already met in case of the encircled blocks, so the other if statements are not executed and the image_index becomes 0. I suggest you take a careful look at your first if statement!
 
B

Ben Hubble

Guest
The condition of your first if statement is already met in case of the encircled blocks, so the other if statements are not executed and the image_index becomes 0. I suggest you take a careful look at your first if statement!
Yeah, just realized that when I was at school but my school had gmc blocked so I couldn't put this up earlier
 
Top