Find Jobs
Hire Freelancers

Building a Game

€8-30 EUR

종료됨
게시됨 4년 이상 전

€8-30 EUR

제출할때 지불됩니다
We look at a square, tiled section of the Antarctic world with a fixed side length of 41. In Antarctica, the tiles are represented by a two-dimensional array of animals, with a zero value for an empty field. The world is cyclic, i.e. if an animal runs out of the world to the left, it is placed on the field furthest to the right of the corresponding line (and vice versa). The same applies to the top and bottom. The coordinate system of the world behaves in such a way that tiles with y-value 0 are at the top, and higher y-values at the bottom. Animals are instances of a subclass of the abstract class Animal. They have an alive attribute that ensures that they are drawn. Dead animals are not drawn. For each animal a method public boolean canEat(Animal animal) is already implemented in the template, which returns whether this animal can eat any other animal, according to the hierarchy shown above (arrows indicate that this species eats another animal, e.g. the whale eats penguins). However, this method still requires implementations of the following methods in each of Animal's subclasses: protected abstract boolean eatenBy(Penguin penguin); protected abstract boolean eatenBy(PlayerPenguin playerPenguin); protected abstract boolean eatenBy(Whale whale); protected abstract boolean eatenBy(LeopardSeal leopardSeal); protected abstract boolean eatenBy(Fish fish); Whereby these methods do NOT check whether the animals are on neighbouring fields, but only whether it comes according to the hierarchy to the food. Movement of animals Depending on the species, the animals have similar movement patterns. Basically, the animals have the following movement preferences: Fish: 1. above, 2. right, 3. below, 4. left All other species (Penguin, LeopardSeal, Whale): 1. left, 2. up, 3. right, 4. down First the animals check the adjacent fields in the order indicated whether there is food there. If this is the case, they move to the first such field for which the move is allowed. If you cannot move to any field with food, move to the first allowed field (also in the order given). Moves to a field with another animal that cannot be eaten by the moving animal are not allowed. Animals also never move to a field where a hunter borders in one of the four directions. If there is no allowed move for an animal, it does not move. There is also a PlayerPenguin class, which is a subclass of Penguin, but controlled by the player. Movements are made in turns, with the player always moving first and then in the following order: Whale LeopardSeal penguin fish Animals of the same species are moved in the order of their occurrence in the respective array. Eaten animals lose their lives and disappear from the tile. Dead animals no longer move. End of the game The goal of the player is to move to the field of the other penguin. The player wins the moment he moves to the square where the other penguin is. The move of the other penguin or all other animals is then no longer performed. The player loses if he moves to a field with a soul leopard or a whale. Furthermore, the player loses if the player penguin or the other penguin is eaten. Implementation of the game process Implement the method public void move() in the classes Animal and Fish. Movements (example) No results Implement the method public boolean move(int newX, int newY) in the PlayerPenguin class. Your method sets the player to the corresponding position. It also returns true if the game is over at the moment you win or lose. There is no need to check whether the player is teleporting, i.e. whether the new position is really only one step away. More Information in the Files
프로젝트 ID: 22743852

프로젝트 정보

3 제안서
원격근무 프로젝트
활동 중 4년 전

돈을 좀 벌 생각이십니까?

프리랜서 입찰의 이점

예산 및 기간 설정
작업 결과에 대한 급여 수급
제안의 개요를 자세히 쓰세요
무료로 프로젝트에 신청하고 입찰할 수 있습니다
3 이 프로젝트에 프리랜서들의 평균 입찰은 €87 EUR입니다.
사용자 아바타
Hain, You can send me your work to me. I am ready to do your work with low cost. I love to do your work very professionally and do't think about cost. Please feel free to contact with me. Thanks Gopal
€50 EUR 7일에
0.0 (0 건의 리뷰)
0.0
0.0
사용자 아바타
I can do it but for 100, if you are interested in, send me a private message and we can discuss the details
€111 EUR 5일에
0.0 (0 건의 리뷰)
0.0
0.0
사용자 아바타
I am experienced with developing 2 dimensional games in java. This project sounds like no difficulty.
€100 EUR 7일에
0.0 (0 건의 리뷰)
0.0
0.0

고객에 대한 정보

국기 (GERMANY)
Munich, Germany
3.9
4
결제 수단 확인
11월 22, 2019부터 회원입니다

고객 확인

감사합니다! 무료 크레딧을 신청할 수 있는 링크를 이메일로 보내드렸습니다.
이메일을 보내는 동안 문제가 발생했습니다. 다시 시도해 주세요.
등록 사용자 전체 등록 건수(일자리)
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
미리 보기 화면을 준비 중...
위치 정보 관련 접근권이 허용되었습니다.
고객님의 로그인 세션이 만료되어, 자동으로 로그아웃 처리가 되었습니다. 다시 로그인하여 주십시오.