Jump to content


Photo

Precise map collisions


  • This topic is locked This topic is locked
1 reply to this topic

#1 slam drago

slam drago

    The slam drag

  • New Member
  • 422 posts
  • Version:GM:Studio

Posted 02 March 2012 - 06:48 PM

So basically, I want to make a game where I draw the levels in photoshop and them import them into Game Maker.

This makes it easier to do wacky stuff like 360 curves and such.

So I started making this game, and it is kind of working. As long as I draw flat surfaces and don't do curves, it works like a charm.

Now obviously this isn't what I was intending, I want to do wacky things.

This code is in my players key left event (I duplicated it for the key right event).
if(!place_meeting(x-4,y,obj_map)){
    x = x - 4;
    exit;
}
var yy;
yy = 0;
while(yy < 32){
    if(!place_meeting(x-4,y-yy,obj_map)){
        x = x - 4;
        y = y - yy;
        exit;
    }
    yy = yy + 1;
}

Now this is the code I believe that won't let me go over curves and stuff.

My collision code is this (in case you want it):
y = yprevious;
if(place_meeting(x+1|x-1, y,obj_map)){
    x = xprevious;
}

move_contact_all(direction,-1);

What do you think is wrong?
  • 0

#2 slam drago

slam drago

    The slam drag

  • New Member
  • 422 posts
  • Version:GM:Studio

Posted 04 March 2012 - 02:05 AM

Bump.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users