Once you learn the code you should be able to modify it when needed. That the player is responsive to the keys If number 1 and 2 are coordinating with the keyboard The app loaded with no issues or troubleshooting requiredĬhecking if the game files are accessible and opening in the app Then you add the code and image for the win outcome and we move onto debugging and modification:įor the app loaded and game to be visible If(Player = 4 & countLength % greenLength =0) If(Player = 0 & countLength % blueLength = 0) GetWorld().addObject(new YouLose(), getWorld().getWidth()/2, getWorld().getHeight()/2) If(countLength>15 & isTouching(Player.class)) Lets look at the code adopted for if you lose: public void act () Now the code in the Player subclass for eating it: Now we add the “Food” subclass and the action to remove each Object on contact to create the illusion of the snake eating the food: GetWorld().addObject(new YouWin(), getWorld().getWidth()/2, getWorld().getHeight()/2) SetImage(new GreenfootImage(“Score: ” + score, 40, Color.BLACK, Color.WHITE)) GetWorld().addObject(new Tail(r, g, b), getX(),getY()) Now we declare the keys and align with the actions for each player. Public Player(int player, int r, int g, int b) I chose to make the players from scratch instead using downloaded images. Now we look at the code behind the players. Create a new world with 600×400 cells with a cell size of 1×1 pixels. I choose 800 x 600 pixels so it would be wide enough for gameplay. if they touched each other its game over for both playersįirstly you must create the world and choose the pixels you wanna allocate to it. This is the object each player is after to get points. Whenever a player collects food, the score goes up and the player with the most wins. STORYBOARD: This is the player icon and the character that will play against each other. It is a plain black screen box game limiting complications. Keeps the player entertained without boring them, guaranteeing regular visits to the sight and plays for the game. HELP: If there’s any other enquires, you can contact via PITCH: This is an older game and it is well-known with a clear objective. TROUBLESHOOTING: If you are unable to play your game, it is recommended to restart the page as there can be connection errors or lagging. You can play online if Internet is available or you can from the Greenfoot application. Arrows for Player 1 and Letters for Player 2. The game is played with the use of a keyboard and the keys are allocated to each player. HOW TO PLAY: The objective in the game is to eat “food”/collect as many points as possible while in competition with another player. I chose Greenfoot is the link to the website you visit to see the choice of Greenfoot games available and you can pick the snake game that I’m going to explain today. Without these basic components of the computer working, the software for the game, ie Green foot, cannot function.įirstly, to acquire the software you must download the software is compatible or designed with. The game consists of two players which adds a competitive element to the game and keeps it interesting.ĬPU, Internet (Optional) PC and Monitor, ROM/RAM space, Graphics card/Display adapter, Internal hard drive etc. The objective of this game is to collect as many objects named “food” in order to win and clear the game. INTRODUCTION: This is a simple game geared towards kids from 9+ years of age. ASSIGNMENT 1 (P1, P2, P3, P4, P5, P6, P7, M1, M2, M3, M4, D1, D2): was sent on Google Classroom
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |