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

2014/7/12

Start of Game

Connected! Connected!

2014/7/12

#
Is it possible to get 'actors' to already be in a position before the game starts because on my game I have to move the 'actors' to their starting position before I can play my game. Do I need to type some co-ordinates somewhere into the code???
Ambar Ambar

2014/7/12

#
Put the following code in the constructor of your background. addObject(new actor(), X-Coordinate ,Y-Coordinate);
danpost danpost

2014/7/12

#
If you are unsure of how to do this, place the actors in your world manually and then go to the menubar and select 'Controls>Save the World'. This will create the code for you. Look in your subclass of World and inspect the code to see what it did. Start with only one or two objects so as not to complicate things too quickly. This is a good way to see your placing actors in code; but, once you learn how, move on and start coding it yourself (both, for the experience of doing it yourself and for more conciseness of code -- you will notice an abundance of excess code if you keep moving things around and then 'Save the World').
You need to login to post a reply.