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

2020/4/10

how would i create an openable door

2
3
4
5
6
Weeb.exe Weeb.exe

2020/4/29

#
danpost wrote...
Weeb.exe wrote...
<< Code Omitted >> how do i fix that?
incompatible types; greenfoot.Actor cannot be converted to OpenableDoor
Sorry, change 1st word in line 3 to "Actor".
now it cant find method isOpen() in line 4
danpost danpost

2020/4/29

#
Weeb.exe wrote...
now it cant find method isOpen() in line 4
Sorry, bit tired right now. Change the line to:
OpenableDoor door = (OpenableDoor)getOneIntersectingObjject(OpenableDoor.class);
Weeb.exe Weeb.exe

2020/4/29

#
danpost wrote...
Weeb.exe wrote...
now it cant find method isOpen() in line 4
Sorry, bit tired right now. Change the line to:
OpenableDoor door = (OpenableDoor)getOneIntersectingObjject(OpenableDoor.class);
lol thats ok go sleep
Weeb.exe Weeb.exe

2020/4/29

#
ok it just opened a terminal window saying
java.lang.NullPointerException at Characters.act(Characters.java:18) at Betty.act(Betty.java:28) at greenfoot.core.Simulation.actActor(Simulation.java:567) at greenfoot.core.Simulation.runOneLoop(Simulation.java:530) at greenfoot.core.Simulation.runContent(Simulation.java:193) at greenfoot.core.Simulation.run(Simulation.java:183)
Weeb.exe Weeb.exe

2020/4/29

#
Weeb.exe wrote...
ok it just opened a terminal window saying
java.lang.NullPointerException at Characters.act(Characters.java:18) at Betty.act(Betty.java:28) at greenfoot.core.Simulation.actActor(Simulation.java:567) at greenfoot.core.Simulation.runOneLoop(Simulation.java:530) at greenfoot.core.Simulation.runContent(Simulation.java:193) at greenfoot.core.Simulation.run(Simulation.java:183)
when i click where it has problems it bounces me to
//in character class       
 if (!door.isOpen()) stopByOpenableDoor(door);
then here
//in Betty class        
super.act();
danpost danpost

2020/4/29

#
if (door != null && !door.isOpen()) stopByOpenableDoor(door);
Weeb.exe Weeb.exe

2020/4/29

#
danpost wrote...
if (door != null && !door.isOpen()) stopByOpenableDoor(door);
cant get near the door now it just teleports me back
danpost danpost

2020/4/30

#
Weeb.exe wrote...
danpost wrote...
if (door != null && !door.isOpen()) stopByOpenableDoor(door);
cant get near the door now it just teleports me back
Progress. YAY!!! Can you be a little more detailed? "teleports me back" to where? how far away? If I am not mistaken, the code "should" let you come just close enough to barely touche it until it is opened.
Weeb.exe Weeb.exe

2020/4/30

#
i think it teleports me a bit away bc the door frame is 200 by 200 however i can't reach it so i can press E
Weeb.exe Weeb.exe

2020/4/30

#
far away enough so i cant even touch the frame
danpost danpost

2020/4/30

#
Weeb.exe wrote...
i think it teleports me a bit away bc the door frame is 200 by 200 however i can't reach it so i can press E
What class does the frame extend?
Weeb.exe Weeb.exe

2020/4/30

#
its just a png file that is 200 by 200 pixels
danpost danpost

2020/4/30

#
Weeb.exe wrote...
its just a png file that is 200 by 200 pixels
That did not answer my question.
Weeb.exe Weeb.exe

2020/4/30

#
sorry what do you need me to clarify?
danpost danpost

2020/4/30

#
danpost wrote...
What class does the frame extend?
There are more replies on the next page.
2
3
4
5
6