Instead of entering ".png" after each image file name, add & ".png" after the imageName value in the programming statement. Instead of entering ".png" after each image file name, add ".png" after the imageName value in the programming statement. Which of the following is an example of string concatenation? Mark for Review In Greenfoot, a local variable is declared at the beginning of a class. ![]() In Greenfoot you can only access the methods of the current class? Mark for Review Use your Greenfoot knowldege: Abstraction occurs in many different ways in programming. In Greenfoot modifying an actors constructor to accept an initial speed is a form of abstraction? Mark for Reviewĥ. Defined methods are methods that are only created by the Greenfoot development team? Mark for ReviewĤ. To execute a method in your Greenfoot game, where is it called from? Mark for Review In Greenfoot a collision is when 2 actors touch? Mark for ReviewĢ. I still don’t know how to use Greenfoot for the sort of tasks needed for OCR GCSE computing yet, but I’m left far more optimistic that there will indeed be a way, as well as admiring the way that Greenfoot helps the student understand, from easy to access code documentation through layout tools to code completion.1. In this session (videos 11-16 from Mik’s blog) a lot has been covered, from the simple steps needed to add sound effects to the game to some massive concepts involving references and object interactions, and on the way we’ve seen a couple of ways that the learner can be helped to focus on the concepts they need to learn rather than getting bogged down in details they just don’t need yet. At this point we also see how to add objects to the world object using code rather than by placing it manually.Ī few adjustments to the point scoring process leaves a complete playable game. The turtle needs to be able to access the counter, and so we learn about constructor methods, and how to pass the world’s counter reference to the turtle. We can then use that class by adding it to the world and calling its methods without worrying how they’re implemented, although the curious can always take a look. At this point in learning the code for a counter object is given, which is another good way of protecting the learner: sometimes you want them to be able to add and use a new class without having to create it, and in this case it’s as simple as copying the code from a text file and pasting it into the new empty class. This produces an interesting new ability, that of creating objects on the fly. This means we have to learn how to create a new bug, obtain the reference to the world and pass the bug reference to that world to make it appear somewhere random. ![]() Then we need to tell the turtle that when it eats a bug we want another bug to appear in the world somewhere random. We add code to the turtle telling it how to eat the bug and add to the score. ![]() ![]() We add a new animal class, a Bug, whose code is mostly copied from the snake as we want it to move by itself. Then comes getting objects to talk to each other. We’ve taken the basic game of turtles moving around and eating lettuces, while being chased by snakes, added a variable to count the number of lettuces eaten and end the game at a set number of points and now we’ve added sound. Now it starts getting much more interesting.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |