Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)
You are not logged in.
Hi ,
I've edited the code in the ZGB tutorial to make a platformer instead of 4 directional scrolling.
I have the character jumping, falling and moving left to right. However I need to do collision with a tile.
How would I write :
If (JUP && colliding with tile 1) {
jump = 1;
}
This code is to be used in the SpritePlayer.c
Bcause at the moment the player can jump in mid air. I would like to only be able to jump if colliding with a platform tile.
Thankyou.
Offline
Ahh got it working.
Heres the code if anybody else runs into map tile collision problems.
if(KEY_PRESSED(J_UP) && goingup==0 && scroll_collisions[GetScrollTile(((THIS->x + THIS->coll_x) >> 3), (THIS->y >> 3) + 2u)]) {
goingup=1;
Offline