Author Topic: Upwards moving solid block  (Read 1634 times)

ShutUpNerd

  • Wannabe
  • Posts: 23
  • OS:
  • Windows 8.1/Server 2013 Windows 8.1/Server 2013
  • Browser:
  • Chrome 39.0.2171.95 Chrome 39.0.2171.95
    • View Profile
  • Playstyle: Keyboard
Upwards moving solid block
« 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?

YoSniper

  • Awexome
  • Global Moderator
  • Spike Dodger
  • Posts: 142
  • People regard me as a programming overlord.
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 39.0.2171.95 Chrome 39.0.2171.95
    • View Profile
    • My YouTube
  • Playstyle: Keyboard
Re: Upwards moving solid block
« Reply #1 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.
I don't traverse the forums as much anymore. Follow me on Twitter if you want to keep tabs on me!

Twitter: @YoSniperGames
Twitch: yosniper

Streams happen whenever I feel like it.

ShutUpNerd

  • Wannabe
  • Posts: 23
  • OS:
  • Windows 8.1/Server 2013 Windows 8.1/Server 2013
  • Browser:
  • Chrome 39.0.2171.95 Chrome 39.0.2171.95
    • View Profile
  • Playstyle: Keyboard
Re: Upwards moving solid block
« Reply #2 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
« Last Edit: January 03, 2015, 10:17:36 PM by ShutUpNerd »

lemonxreaper

  • Administrator
  • Spike Dodger
  • Posts: 222
  • Do you even needle?
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 34.0 Firefox 34.0
    • View Profile
Re: Upwards moving solid block
« Reply #3 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.
Just pretend I have a cool picture like Zero.
Completed Fangames: https://dl.dropboxusercontent.com/u/4678222/Complete%20Fangames.txt

ShutUpNerd

  • Wannabe
  • Posts: 23
  • OS:
  • Windows 8.1/Server 2013 Windows 8.1/Server 2013
  • Browser:
  • Chrome 39.0.2171.95 Chrome 39.0.2171.95
    • View Profile
  • Playstyle: Keyboard
Re: Upwards moving solid block
« Reply #4 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