B
Brian Le
Guest
Hi guys, I got a few problems with my character's sprite and the platform. First of all, the platform can be jumped through by the player when it is under the platform. Secondly, if the player has stood on the platform, the platform's mask index changed into 1.
Also, note that when I first code the game, I used a square-shaped character. When I pressed the Up key, it stood nicely on the platform. However, when I changed the sprite into the my desired images, I noticed that the player stood at a position of about 6 pixels from the platform. The player's sprite is 64x64, and the origin is center. The platform has an origin of 32x16, the origin is 0,0. I have posted some images for better illustration:

Also, here is the platform code
Please help me with this, thanks in advanced
Also, note that when I first code the game, I used a square-shaped character. When I pressed the Up key, it stood nicely on the platform. However, when I changed the sprite into the my desired images, I noticed that the player stood at a position of about 6 pixels from the platform. The player's sprite is 64x64, and the origin is center. The platform has an origin of 32x16, the origin is 0,0. I have posted some images for better illustration:

Also, here is the platform code
Code:
//Create Event:
sprite_index = -1;
//Step Event
if (instance_exists(obj_player)) {
if (round(obj_player.y + obj_player.sprite_height/2) > y + 1 || obj_combokey_controller.force_down) {
mask_index = -1;
}
else {
mask_index = 1;
}
}
//Draw Event
draw_sprite(spr_platform,-1,x,y);