This site requires JavaScript, please enable it in your browser!
Greenfoot back
repertoire
repertoire wrote ...

2020/3/30

Logs in Frogger

repertoire repertoire

2020/3/30

#
Hi, i'm doing a remake of a frogger-like project. I'm stuck on one part of the project where I want my character to move with a moving object with the same speed. This is just for the log/water part of the game. I've set my variables in a "log" class but I can't figure out how to call the variables to make my character move with the same speed. Any help would be appreciated. Thanks
repertoire repertoire

2020/3/30

#
From restarting alot this is what i really have so far. Other than that i don't know where to go.
1
2
3
4
5
6
7
8
public void logMovement(){
        if(isTouching(Logs.class)){
            if(getY() == 256){
                // insert call to Logs class
                // move with the same speed using a variable from the logs class
            }
        }
    }
You need to login to post a reply.