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

2016/1/12

Need help with door and key(Lockpick) system.

1
2
bilibull bilibull

2016/1/22

#
Thanks, i will give it a shot as soon as I have more time to spare! Will update if it will work!
bilibull bilibull

2016/1/25

#
So I tested out my the code that you suggested; While it did do the same job it did as my previous posted code. My actor is still unable to get in the reach of opening the door. It blocks the actor way too well to the point that it no longer cares that the actor is right next to the door and is touching it.
Super_Hippo Super_Hippo

2016/1/25

#
Yes, that's true. That's because the moving part makes sure the actor is not touching a closed door. You could insert the code that checks for the keypress to open the door in the last if-block of the last posted code. So the code that starts like that has to be added there:
1
if (Greenfoot.isKeyDown("e") && Lockpick > 0)
The next two lines are not needed because they are already in the other code.
1
2
Door d = (Door) getOneIntersectingObject(Door.class);
if (d != null && !d.getState())
Hope you understand what I mean.
You need to login to post a reply.
1
2