Greenfoot music player4/9/2023 ![]() After some research, we chose to use character mapping to objects using a String the length of our World. The first challenge, right from the start, when implementing World, was to find a practical and functional way to build the mazes. With that idea in mind it was created as subclasses World Menu, GameOver and Maze, and as subclasses Actor Obstacle, Enemy, Player, Instrument, Life, Dead, Option and BonusPoint. Moving on to the explanation of how the game was implemented, we started by defining classes and subclasses in order to have the minimum of repeated and unnecessary code. If both players lose all their lives without reaching the stage, there is no winner and they will have to try again. To win one of the players will have to reach the board, and the player with the most points wins when the game is over, regardless of whether he has picked up all the objects or not. However, when the stage opens, four Robots appear who are also enemies, making the player have to maneuver to reach the stage. After one of the players has acquired all the instruments, the stage will open, and that player will be able to go there and finish the game. The objective of the game is to collect the instruments scattered around the playing field, trying to collect as many beers and mugs as possible in the process, but avoiding the Dean, who whenever he touches a player takes away a "life" and points. Each player starts with three lives, with a score of zero and with the list of instruments to be filled out, this information is present on the left side of the maze. When the maze is selected, the game with the two players, three Rector enemies, with ten instruments, two of each category, with mugs and beers, which are the bonus points, and the arrival stage where the game ends, is started. It starts with a selection menu where players, with the mouse, select from among three mazes which they want to play. The game developed is based on the Arcade game style where a maze was created with several objects scattered and enemies by it. It was decided on the idea that two members of TUNA would be late for the concert, at the Queima / Enterro enclosure, in which each member had to pick up all the instruments and go to the stage, but on their way, they tried to “drink” as many beers and mugs as quickly and effectively as possible. ConceptĪfter brainstorming about the concept and how to implement the game, from the figures to some methods to be implemented. Throughout this concept you will have a brief introduction to the game and its concept, and an explanation of the implementation of each class along with the different interactions between them. Encapsulation in turn is considered a golden rule of object-oriented programming that objects are independent independent, that is, instance variables are always private, which means that direct access to variables only occurs in the class that it is inserted, through its methods, thus obtaining a greater integrity of the data. It is important to note that Overrinding refers to the redefinition of a method in a subclass, Overloading refers to the definition of a method with the same name, but with a list of different parameters. There is no need to respect the requirements of object-oriented programming: definition and use of methods and variables, initialization of objects using the constructors, result of methods with a minimum of two levels in addition to Actor, Overrinding and Overloading of methods, and encapsulation. ![]() In relation to the game requirements are: having two players playing simultaneously, individual scores that are edited in real time, changes in the appearance of the world during the course of the game, indication of the winner, with a due score obtained at the end of the game. Two types of requirements were requested, game and object-oriented programming. Its main objective is the development and application of the knowledge acquired in class, making an introduction to programming in JAVA, in a more interactive and simplified way for learning with the Greenfoot software. This project was carried out within the scope of the Object Oriented Programming unit, where the aim is to develop a game using a Greenfoot platform, based on the theme of “traditional academic tunas in higher education” (for more information about it (music)).
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |