I Wanna Community

Fangames => Game Design => Programming Questions => Topic started by: ShutUpNerd on January 03, 2015, 06:00:03 PM

Title: Upwards moving solid block
Post by: ShutUpNerd on January 03, 2015, 06:00:03 PM
So I wanted to make a solid block that would move upwards and also be able to carry the player upwards like a platform
Because of the way gamemaker treats solid objects this has proven extremely difficult to do, and I honestly cannot think of anything I haven't tried yet.

Does anybody know how this could be done?
Title: Re: Upwards moving solid block
Post by: YoSniper on January 03, 2015, 06:33:04 PM
So I wanted to make a solid block that would move upwards and also be able to carry the player upwards like a platform
Because of the way gamemaker treats solid objects this has proven extremely difficult to do, and I honestly cannot think of anything I haven't tried yet.

Does anybody know how this could be done?

While I don't recommend using solid objects at all in Game Maker, I think the best approach is to set the player's y coordinate upon colliding with the player, i.e. something like:

Code: [Select]
if place_meeting(x, y-1, player) {
    player.y = y - 8;
}

Note that this is not complete nor foolproof code. Again, I don't recommend using solid objects, but this might get you on the right track.
Title: Re: Upwards moving solid block
Post by: ShutUpNerd on January 03, 2015, 10:11:26 PM
Quote
While I don't recommend using solid objects at all in Game Maker, I think the best approach is to set the player's y coordinate upon colliding with the player, i.e. something like:

Code: [Select]
if place_meeting(x, y-1, player) {
    player.y = y - 8;
}

Note that this is not complete nor foolproof code. Again, I don't recommend using solid objects, but this might get you on the right track.

alright, so i started making this object a non solid one, everything mostly works except when the platform goes upwards the kid kinda spazzes and when i try to jump off it it only gives me one jump

i have this in the step event

Code: [Select]
with(player){
if(place_meeting(x,y+vspeed,thwomps))
{
if y < other.y

{
    y = other.y-9;
    vspeed = other.vspeed;
 
 
  onPlatform = 1;
  djump = true;
}

if  y > other.y{move_contact_all(90,abs(vspeed));vspeed=0}
}
}

note that those variables are from yuutu engine
Title: Re: Upwards moving solid block
Post by: lemonxreaper on January 04, 2015, 11:23:45 AM
if you get the newest version of yuuutu (2.1)
there is an object called LiftBlock
i think maybe that's the kind of thing you are looking for.
Title: Re: Upwards moving solid block
Post by: ShutUpNerd on January 04, 2015, 01:27:30 PM
if you get the newest version of yuuutu (2.1)
there is an object called LiftBlock
i think maybe that's the kind of thing you are looking for.
thanks, but the case has been solved, i managed to make an object that mimics a solid block but has the riseBlock parent