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

2014/6/11

My walls...

SullyFish SullyFish

2014/6/11

#
Im trying to figure out how to make my walls work properly right now Im just using actors move-10 when touching but its very flawed obviously, but I just cant figure out how to make it just stop movement from getting through, its in my smooth mover class and this is the Contact code
public void Contact(){
        if(getOneIntersectingObject(walls.class) != null){
            move(-10);
        }
    }
Ive tried exactY and exactX stuff but It just results into no difference except for the projectiles which use vector
Pointifix Pointifix

2014/6/11

#
if the actor does not move with the same speed as here it will not stand still, if the actors speed is at 10 as in this example then it should stand still, simply cause when you move the actor and then move it back the exact same distance it stands still. Hope this was usefull, otherwhise i understood something wrong ;) greeting, Pointifix
SullyFish SullyFish

2014/6/13

#
Sadly the problem is when the actor moves sideways it stays in the wall and rockets off to the side
danpost danpost

2014/6/13

#
You need to supply the name of Actor class and movement code of the actor (or preferably the entire class). Knowing how the actor moves will help in arriving at a solution.
You need to login to post a reply.