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

Report as inappropriate.

RcCookie
RcCookie presents ...

2020/9/18

Movable World

This is a reusable class called 'Container' that represents a world, but actually is an actor. Therefore, you can do all sorts of stuff with it that you normally can't like moving it around, turning it or, quite handy if you think about it, display other stuff next to it (-->UI).
The Container class contains any actors without changing ANYTHING for them. Just use the normal 'addObject' method you know from normal worlds, but use the one of the container. It also features all the other methods that a normal world has.

Showcase:
Move the little blue square, the actor, around using the arrow keys.
Move the big light red square, the container, around using wasd.

1417 views / 993 in the last 7 days

3 votes | 1 in the last 7 days

Tags: game simulation demo with-source world container reuse

This scenario is a member of: Reusable classes


open in greenfoot
Your browser does not support the canvas tag.
A new version of this scenario was uploaded on 2020-09-18 19:45:30 UTC Overhaul of saving system! Removed ContainerActor; now the container can store any actors which allows to be much more flexible because you don't have to base your classes on it. Added 'setActOrder' functionallity
A new version of this scenario was uploaded on 2020-09-18 19:51:26 UTC Fixed some bugs
A new version of this scenario was uploaded on 2020-09-18 20:01:42 UTC Fixed some bugs
A new version of this scenario was uploaded on 2020-09-18 20:04:22 UTC Fixed some bugs
A new version of this scenario was uploaded on 2020-09-18 20:11:38 UTC Improved demo
A new version of this scenario was uploaded on 2020-09-18 20:20:20 UTC Increased performance

Want to leave a comment? You must first log in.

Who likes this?

AbdulrazaqAS Game/maniac ChafikAZ