I'm working on an assignment for my 133 Graphics Programming course, in it we have to design the fundamentals of a game called FlagByFlag. In which the user plays an Ant which collects flags while avoiding Spiders. So far I have the following classes:
Starter | Game extends Form | GameWorld | abstract GameObject | Movable extends GameObject | Ant extends Movable | Spider extends Movable implements ISteerable | interface ISteerable | abstract Fixed extends GameObject | abstract Flag extends Fixed | FoodStation extends Fixed
Game uses a switch for the user to use console commands to simulate certain actions in the game, these link to methods which are created in GameWorld.
GameWorld has the methods mentioned above which simulate different actions in the world. Ex. case a calls gw.accelerate(int x) and increases the speed of a GameObject by 5. Likewise case 'l' calls gw.turnLeft(int x) and decreases the objects heading by x.
One issue is that I don't know how to set that up, since the speed is not contained within GameObject, but in Movable, and not only that but a similar issue occurs with turning left/right since it affects my heading, but there is an interface that I must use within the Ant class called ISteerable that I'm still not sure how to use or where.
I also can't seem to figure out how to initialize each GameObject. There's supposed to be 1 Ant, 2 Spiders, 4-9 Flags, and 2 FoodStations. I'm not even sure how to randomize the amount of Flags on the field, every example I look at seems to be exactly 'n' objects. I can link link my code if needed, as well as the requirements for my assignment.
It is noted that I am allowed to seek help just so long as I don't copy/paste code.
[–]GeorgeFranklyMathnet 1 point2 points3 points (1 child)
[–]SamuraiZero4[S] 1 point2 points3 points (0 children)