Now that (hopefully) you are warmed up to the idea of using loops, here is the last suggestion I have for you on how to use them in Greenfoot.Īdding an interface to effect multiple Actors (across different classes) – FreezingBrick public void addLine(String name, int startX, int startY, int n, double dx, double dy).public void addRandom(String name, int n).Loops that need to be written can be found in the following methods: Here is the demo video of your tasks in the WorldBuilder The exercises are intended to help you build your levels, they can all be found in the WorldBuilder Class From here you should be able to start making your game. After this we’ll add some mandatory features that require more looping but the rest is up to you. This is the last round to “fix my code” so that you will now see a PlatformWorld/PlatformMover coming to life. This must included the main character itself so that it’s movement + the reverse movement will make it stationary but the background will move making it appear to move. Your next task is to fix the scrolling world so that all of the other Actors in the World move away from the main character whenever the window is moved (scrolling happens). If you are curious about how it is done better, one method is the Separate Axis Theorem. The methods you will “fix” are:Īs an aside… this is not a very efficient method for collision detection. Your first job is to complete the reactions a PlatformMover must have when it collides with a Platform. Otherwise, leave my code alone and subclass the file you would like to make additional features to or change the behaviour of. IMPORTANT – you should only fix the code where I have instructed you to do so. As you follow the lessons below you will edit these files so save it somewhere for future reference. Here is the Skeleton framework for the Platform game that you will fix before you start your own adventure.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |