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

2012/11/27

How can I create red brick square on greenfoot?

Future Future

2012/11/27

#
I am trying to create a game which requires a robot, a bomb and a redbrick square, the robot has to pick up the bomb and put it in the redbrick square. I have been looking for a code to get a square/rectangle but i could not find anything. Can anyone help?
danpost danpost

2012/11/28

#
We could say that the code to get a square/rectangle is built into the GreenfootImage of the Actor. Each actor has an 'image' which IS a rectangular area. Within the bounds of this rectangle is where the image of the actor appears. You only need to create a GreenfootImage object of appropriate size and draw along each edge the image of the brick (just program it to draw one edge, then rotate the main image to continue drawing the brick image around all four edges).
You need to login to post a reply.