r/javahelp • • Mar 11 '18

Farm Simulator java

Hi guys, I need help with my java project for school. I need to make a farm simulator where I will have two types of plants (tomatoes and cabbage), a farmer and sheeps. The objective of the game is win points by planting , caring and gather the plants. The farmer is controlled by the keyboard arrows and to do action you press space. How it works: It starts with a fixed configuration (a farm 7x5, without plants and the farmer in top right corner) 2.When you press a key it counts like a 1 game cycle for all objects. 3. You got tomatoes and cabbages. 4. The camps can be for plowing or plowerd already. 5. In plowerd camps you can have : nothing, small vegetables,vegetables ready to gather or ruined. Interactions: Farmer - for plowing camp: the camp get plowerd. Farmer- plowed camp: Plants randomly tomatoes or cabbages. Farmer - Small vegetables: Farmer takes care of platns, at the case of cabbages that speed up their growth, at the case of tomato it only get mature if the farmer had already interact with them. Farmer-Sheep: Feeds the sheep. Sheep-Plants- If the sheep isn't feed for the last 10 cycles she eats the platns. Tomato: mature after 15 cycles, ruined after 25 cycles. Cabbage: mature after 10 cycles,ruined after 30.

https://gyazo.com/476ca626054ea57bbe487b11b22953f3- Uml

0 Upvotes

5 comments sorted by

View all comments

5

u/flaghacker_ Mar 11 '18

What's your question?

1

u/n4kst4 Mar 11 '18

I can't really make out how should I start

4

u/desrtfx Out of Coffee error - System halted Mar 11 '18 edited Mar 11 '18

Good start: Think about your interfaces and classes and program each individually. Start with the Interactable interface followed by the other interfaces and then the Vegetable and Animal classes.

For the main class, take a look at Java Game Loops because it will give you some ideas how to run the actual simulation.

We will not give you any further details because this is not /r/domyhomework.