v0.9 is out! Just a couple of minor bugfixes for this version.
1) I've fixed the roomChanger object, so you should be able to walk between rooms now if you place one at the edge. If you're using an older version of the engine, just add
onCollide=true
to the create event of the roomChanger object to fix.
2) Also fixed an issue where if you place a platform next a block, the player gets sucked in. This only occurs if you place the block
after the platform in the room editor, if you place the blocks first it shouldn't. If you're using an older version of the engine, you can place all blocks first, then platforms, or you can replace the player's end step event code with the following:
//Check for collisions with blocks
xx=round(x)+.5;
yy=round(y);
var a,b;
a=-1;
o = collision_rectangle(x-5.5,y-12,x+5.5,y+8.5,block,1,1);
while (o != noone) {
//if this is a platform, just ignore it
if (o.object_index==platform || object_is_ancestor(o.object_index,platform)) {
//store this object for later, and deactivate it
a++;
b[a]=o;
instance_deactivate_object(o);
o = collision_rectangle(x-5.5,y-12,x+5.5,y+8.5,block,1,1);
continue;
}
if (o.solid) {
x=xprevious;
y=yprevious;
}
if (place_free(xx+hspeed,y) == false) {
if (hspeed <= 0) { // Left | 左
move_contact_solid(180,abs(hspeed));
}
if (hspeed > 0) { // Right | 右
move_contact_solid(0,abs(hspeed));
}
hspeed = 0;
}
// strange bug in GM studio - keep player from turning around and getting stuck in the wall behind him
if (!place_free(x,y)) {
if (place_free(x-1,y)) x-=1;
else if (place_free(x+1,y)) x+=1;
}
// Check for blocks above/below | 上下に壁がある時
if (place_free(x,y+vspeed) == false) {
if (vspeed <= 0) { // Above | 上
move_contact_solid(90,abs(vspeed));
y=ceil(y); //shift the player down so we don't end up inside the block (prevents deaths to spikes in block)
}
if (vspeed > 0) { // Below | 下
move_contact_solid(270,abs(vspeed));
djump = true; //restore djump if standing on a block
}
vspeed = 0;
}
// 斜めの位置に壁がある時
if (place_free(x+hspeed,y+vspeed) == false) {
hspeed=0;
}
if (o.solid) {
x+=hspeed;
y+=vspeed;
}
//Fix for platforms - if you place a platform against a wall and run toawrds the wall while jumping up
//the platform will attempt to shift you to the top of it, but the x=xprevious y=yprevious
//code here will return you down, thus getting you caught in a loop and making the kid get stuck.
if (y_offset != 0) {
y=y_offset;
}
//store this object for later, and deactivate it
a++;
b[a]=o;
instance_deactivate_object(o);
o = collision_rectangle(x-5.5,y-12,x+5.5,y+8.5,block,1,1);
}
//reactivate all the objects we turned off during collision testing
while (a>=0) { instance_activate_object(b[a]); a--; }
if (place_meeting(round(x),round(y),playerKiller)) {
killPlayer();
}
y_offset=0;
This was my fault for only considering one block collision per frame, so it's possible this solves other issues where you can collide with multiple blocks at a time. Thanks to Lothjon and Kyir for the bug reports! Hopefully there's not much left to fix!