P
Power_Michael
Guest
Hey everyone, I have this simple game where a block changes sprite over time (an alarm) and it turns into a bigger sprite, then over time this sprite changes to a bigger one. I knew this would pose a few problems that I could easily fix, one being that when the sprite changes to a bigger sprite, the object gets stuck in the ground....to fix that I changed the y-axis center of the bigger sprites to be lower so when they would not get stuck in the ground. Now...My new problem is:
When the object is still a little sprite and in a small compact area (a roof above or something)...and then it changes into a big sprite..it is stuck inside of the roof! Or...lets say as a little sprite, the object is as close as it can be to a wall....and then it grows....it ends up being wedged inside of the wall. I am stuck with this issue...I was wondering if anybody knew a way I could make it so if it is too close to a block or something...when the sprite changes it moves it away and then changes? I will post the code I have for making the sprite change over time below:
Create:
(Nothing in step)
Alarm[0]:
So again....What is happening here is over time...the objects sprite changes from little sprite to a bigger sprite...and it continues getting bigger. The problem is when it is too close to a wall and it gets bigger it gets stuck inside of the wall. If you guys know a way I can make it move away from the wall THEN grow...that would be great. If you guys want me to interpret something better or have any questions just let me know below.
Thank you!
-Michael
When the object is still a little sprite and in a small compact area (a roof above or something)...and then it changes into a big sprite..it is stuck inside of the roof! Or...lets say as a little sprite, the object is as close as it can be to a wall....and then it grows....it ends up being wedged inside of the wall. I am stuck with this issue...I was wondering if anybody knew a way I could make it so if it is too close to a block or something...when the sprite changes it moves it away and then changes? I will post the code I have for making the sprite change over time below:
Create:
Code:
alarm[0] = room_speed * 10;
//I also have a drag and drop ALARM 0 that is set to "1000 steps).
Alarm[0]:
Code:
if (sprite_index == spr_babyBox) {
sprite_index = spr_smallBox;
alarm[0] = room_speed * 10;
}
else if (sprite_index == spr_smallBox) {
sprite_index = spr_mediumBox;
alarm[0] = room_speed * 10;
}
else if (sprite_index == spr_mediumBox) {
sprite_index = spr_largeBox;
alarm[0] = room_speed * 10;
}
So again....What is happening here is over time...the objects sprite changes from little sprite to a bigger sprite...and it continues getting bigger. The problem is when it is too close to a wall and it gets bigger it gets stuck inside of the wall. If you guys know a way I can make it move away from the wall THEN grow...that would be great. If you guys want me to interpret something better or have any questions just let me know below.
Thank you!
-Michael