This is the last assignment from an older Java Exam for my university course. If you got some free time, feel free to post your solutions to the assignment. Would be very instructive for me.
I will try my best to translate the problem to English.
You have been obligated to write an algorithm that will be used in a Space Invader-type of game to handle shots fired from the player at the enemies.
The entity of the player can only move horizontality. The enemies can move both horizontality and vertically.
The shots fired only move vertically (from the position of the player’s ship), and many shots fired can be active at the same time. The enemies and the shots approximates with rectangles.
Your task is to implement two methods:
a) boolean isHit(Enemy e , Bullet b ) that asks the question if an enemy (e) has been hit by a shot (b). (3p)
b) void gameRunning(). That is the game’s main method. The method should have a loop that moves the enemies, the shots fired and to call isHit() for control. (1p)
LOL Really? If you have some time feel free to post the answer? This isn't how it works... We're not here to answer your examquestion, try to solve it yourself and when you get stuck post a question, don't ask us to write the entire program for you. Or you could but then we charge you 150€ an hour, that's about what a medior java developer goes for in Belgium
It's good to be able to use someting, it's better to understand how it works.
posted 4 days ago
Daniel Demesmaecker wrote:LOL Really? If you have some time feel free to post the answer? This isn't how it works... We're not here to answer your examquestion, try to solve it yourself and when you get stuck post a question, don't ask us to write the entire program for you. Or you could but then we charge you 150€ an hour, that's about what a medior java developer goes for in Belgium
Well yeah i know. But you people seem to love java. Someone might think it was a fun challenge.
It's not an assignment that i would turn in, it's an problem for an old exam. But yeah I understand what you are saying.
I would like to know more about those Enemy objects. Actually, those questions worry me. It doesn't say which class they ought to be in. Maybe the second should be called run() instead of isRunning(), so you can write something like this:-Actually, I think you would run the player and the enemies on separate threads. And that will be €15000000000000000000000000000000000000000000000000000000 please. You'll get a 100% discount if you find more than four mistakes in what I wrote
posted 3 days ago
Nobody found anything wrong yet?
We should throw him a surprise party. It will cheer him up. We can use this tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database