
-----------------------------------
computers321
Sat Jun 18, 2016 2:09 pm

Correcting Platform Collisions
-----------------------------------
What is it you are trying to achieve?
Trying to code a 2D platformer game as my final task for Computer Science. 


What is the problem you are having?
My platform collisions don't entirely work. I can jump up onto platforms and jump on them multiple times (thanks to some tutorials I found here), but when I try and jump down onto another platform, the character (right now a box) falls straight through.


Describe what you have tried to solve this problem
Tried to use whatdotcolour, didn't work very well. Tried to play with the collision if statements, still not working.


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Here's the specific area, the file is in its entirety below.



if chary = PLATFORM - 4 and charx >= 0 and charx = 0 and charx  0 then
        chary := PLATFORM
    end if

    if chary = PLATFORM + 56 and charx >= 120 and charx = 120 and charx  0 then
        chary := PLATFORM + 60
    end if

    if chary = PLATFORM + 136 and charx >= 30 and charx = 30 and charx  0 then
        chary := PLATFORM + 140
    end if

    if chary = PLATFORM + 146 and charx >= 230 and charx = 230 and charx  0 then
        chary := PLATFORM + 150
    end if

    if chary = PLATFORM + 26 and charx >= 530 and charx = 530 and charx  0 then
        chary := PLATFORM + 30
    end if

    if chary = PLATFORM + 66 and charx >= 420 and charx = 420 and charx  0 then
        chary := PLATFORM + 70
    end if



These statements deal with platform collisions.

Please specify what version of Turing you are using
It's an IDE to be used on OS X. It's called Turing IDE - Made by Oswald Pan. Seems to have everything 4.1.1 has.
