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

2016/3/1

Can't remove object

1
2
thewisegamer thewisegamer

2016/3/1

#
when my main actor(hunter) walks and if he get the castle, it brings him to level 2. I already created the codes and no error, but when my hunter go to castle, nothing happens. Is this because my castle is too big? my hunter size 30x45 and the castle size 150x193. Can someone help me? thanks
Super_Hippo Super_Hippo

2016/3/1

#
Show how you implemented it in your code. Without seeing the code, we could only guess.
thewisegamer thewisegamer

2016/3/2

#
in main actor:
public void exit()
   {
        if (getcastle(castle.class))
        ((MyWorld)getWorld()).nextLevel(); 
   }

   public boolean getcastle(Class clss)
   {
        Actor actor = getOneObjectAtOffset(0, 0, clss);
        return actor != null;        
   }
in myworld(level 1):
public void nextLevel()
    {
        Greenfoot.setWorld(new castle());

    }
new castle is level 2
Super_Hippo Super_Hippo

2016/3/2

#
Well, this doesn't make sense... You check if it touches a castle and then, you set a new castle class as the new world? Is the castle a world or an actor?
thewisegamer thewisegamer

2016/3/2

#
Oh my God thank you so much, you make me realized that I put the wrong name. I put the same name "castle" both in that methods. I changed it and now it works, thankyou super_hippo :)
follow for folow
JOSHIEWOSHIE44 JOSHIEWOSHIE44

2016/3/2

#
yes michbog
JOSHIEWOSHIE44 JOSHIEWOSHIE44

2016/3/2

#
michaelrosensBIGPLUMS wrote...
follow for folow
YES MICHBOG
krekraw krekraw

2016/3/2

#
f4f evrything returned til 100 likes
krekraw krekraw

2016/3/2

#
anyone selling any koosh?
YES!!!
krekraw krekraw

2016/3/2

#
how much?
JOSHIEWOSHIE44 JOSHIEWOSHIE44

2016/3/2

#
i want some plums
michaelrosensBIGPLUMS wrote...
YES!!!
krekraw wrote...
anyone selling any koosh?
20KG
JOSHIEWOSHIE44 wrote...
i want some plums
michaelrosensBIGPLUMS wrote...
YES!!!
krekraw wrote...
anyone selling any koosh?
krekraw wrote...
how much?
JOSHIEWOSHIE44 JOSHIEWOSHIE44

2016/3/2

#
oooooooooo nouice
michaelrosensBIGPLUMS wrote...
20KG
JOSHIEWOSHIE44 wrote...
i want some plums
michaelrosensBIGPLUMS wrote...
YES!!!
krekraw wrote...
anyone selling any koosh?
krekraw wrote...
how much?
JOSHIEWOSHIE44 wrote...
i want some plums
michaelrosensBIGPLUMS wrote...
YES!!!
krekraw wrote...
anyone selling any koosh?
There are more replies on the next page.
1
2