Galabugs Invaders

Recommended levellevel
10+
If you think the most successful computer game is one of the multi-million dollar blockbusters of recent years, you're mistaken! This honor goes to the good old (well, good in its own way) Space Invaders, which has brought developers roughly 10 billion dollars in inflation-adjusted profits. It had a huge impact not only on the video game industry, but also on pop culture: even if you've never played Space Invaders, you would probably recognize the shapes of the invaders and the brave spaceship standing against them in the starry cosmos. It was back in 1978 that the game appeared on arcade machines, telling the story of a lone pilot who repulses hordes of aggressive crab-like aliens. Since then, it has spawned oodles of new editions on every imaginable platform and saved the Atari 2600. Today the latest versions have been released for Android and iOS. Now it's your turn! Write your own version of Space invaders right here on CodeGym under the watchful supervision of our senior developers. Your game will be similar to the classic version: set in outer space, with cute 8-bit graphics, the ability to shoot at belligerent invaders, both the rank-and-file and the "generals" who lurk behind them, and the ability to evade enemy fire by dodging left and right. The player must fight until he or she kills all the ordinary aliens and the boss. Or until he or she is struck down by an alien blast. We aren't looking for an easy way out. That's why our version will be harder than the original: the player gets only one life.
Comments (70)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Andrei Karavai
Level 29
21 November 2023, 15:40
Подскажите, как должен выглядеть метод isCollision(GameObject)? И в каком классе он должен быть? в GameObject? Указано, что класс должен быть, а в игре его нет...
Andrei Karavai
Level 29
21 November 2023, 15:43
трындец, в 18 таске подгрузился метод isCollision😖 причём нефиговый такой:
public boolean isCollision(GameObject gameObject) {
        for (int gameObjectX = 0; gameObjectX < gameObject.width; gameObjectX++) {
            for (int gameObjectY = 0; gameObjectY < gameObject.height; gameObjectY++) {
                if (gameObject.matrix[gameObjectY][gameObjectX] > 0) {
                    if (isCollision(gameObjectX + gameObject.x, gameObjectY + gameObject.y)) {
                        return true;
                    }
                }
            }
        }
        return false;
    }
Нешта пайшло не так😂
papaperejivaet
Level 37
18 November 2023, 13:23
Спустя 22 задачи у меня выскочило исключение Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 64 out of bounds for length 64 Это как понимать ?
Unholy intromen QA Automation Engineer at СберТех
2 July 2023, 21:45
У кого нибудь еще есть проблема с тем, что звезды отображаются как три точки?
Andrei Karavai
Level 29
21 November 2023, 15:45
если выбрать какой-нибудь понтовый символ, а не обычную звёздочку - то да, у меня отображалось как 3 точки, попробуйте другой символ для звёздочки выбрать
31 May 2023, 21:02
https://javarush.com/projects/apps/408218#discussion
Иван
Level 25
17 December 2022, 09:33
попробуйте!
Иван
Level 25
17 December 2022, 09:33
https://javarush.com/projects/apps/375206
30 September 2022, 08:31
public class Star extends GameObject { public Star(double x, double y) { super(x, y); //просто "разнес скобки" и прокомментировал }
30 September 2022, 08:31
public class Star extends GameObject { public Star(double x, double y) { super(x, y); //просто "разнес скобки" и прокомментировал код } }
overbf bf
Level 40
2 August 2022, 11:38
Я считаю количество вражеских кораблей вот так: int enemyCount = 0; for (GameObject a : ships){ if (a instanceof EnemyShip){ enemyCount++; } Почему это не правильно? Почему не проходит валидацию?
overbf bf
Level 40
2 August 2022, 12:03
а если вот так - то все работает... int enemyCount = ships.size();
1 August 2022, 16:32
Только у меня на ноутбуке отображается в очень странном виде? Игрока совсем не видно, например