CodeGym
Promotion
CodeGym University
Nauka
Kurs
Zadania
Ankiety & Quizy
Gry
Pomoc
Harmonogram kopniaków w tyłek
Społeczność
Użytkownicy
Forum
Czat
Artykuły
Historie sukcesu
Aktywność
Opinie
Subskrypcje
Jasny motyw

Zadania

  • Opinie
  • O nas
Rozpocznij
Rozpocznij naukę
Rozpocznij naukę teraz
  • Wszystkie zadania
Wszystkie misje Składnia Java Podstawy Java Wielowątkowość w Java Kolekcje w Java JSP i serwlety Składnia Java Pro Gry
Wszystkie poziomy Poziom 0 Poziom 1 Poziom 2 Poziom 3 Poziom 4 Poziom 5 Poziom 6 Poziom 7 Poziom 8 Poziom 9 Poziom 10 Poziom 11 Poziom 12 Poziom 13 Poziom 14 Poziom 15 Poziom 16 Poziom 17 Poziom 18 Poziom 19 Poziom 20 Poziom 21 Poziom 22 Poziom 23 Poziom 24 Poziom 25 Poziom 26 Poziom 27 Poziom 28
Dowolny status Dostępny W toku Ukończony Zamknięte
  • Space Invaders (Part 24/34)

    Games
    Poziom 0, Lekcja 6
    When you release the left key or the right key, the ship does not stop moving until it hits the edge of the playing field. Let's fix that. We'll override the Game class's onKeyReleased() method. This method is called when keys are released. If the player's ship is moving, the onKeyReleased(Key) met
    3
    Niedostępne
  • Space Invaders (Part 25/34)

    Games
    Poziom 0, Lekcja 6
    Now we'll prepare to give the player the ability to shoot. For this, we need a fire() method that will create projectiles. We will store them in the playerBullets list. Add logic to draw projectiles in the drawScene method, and to move them — in the moveSpaceObjects method. Now all that remains is
    3
    Niedostępne
  • Space Invaders (Part 26/34)

    Games
    Poziom 0, Lekcja 6
    In this part of the project, we'll add the ability to shoot by pressing the spacebar. The player's newly created projectiles are added to the playerBullets list, while those that have flown off the screen are removed from it. To remove the projectiles, you can either use an iterator, or create a co
    3
    Niedostępne
  • Space Invaders (Part 27/34)

    Games
    Poziom 0, Lekcja 6
    Let's override the method for destroying an enemy ship. It sets the isAlive field to false and sets the destruction animation matrix. We'll also create an isVisible() method in the Ship class. It will return false after the entire animation has been displayed for a "dead" ship.
    3
    Niedostępne
  • Space Invaders (Part 28/34)

    Games
    Poziom 0, Lekcja 6
    At this stage, we'll add a checkHit(List bullets) method for checking whether the player's projectile has hit an enemy ship. After a hit, we need to "kill" the corresponding projectile and enemy ship. Additionally, we'll add a deleteHiddenShips() method that will remove "hidden" ships from
    3
    Niedostępne
  • Space Invaders (Part 29/34)

    Games
    Poziom 0, Lekcja 6
    It's time to create the enemy boss. To make him look tougher, we'll add an animation when he moves. If the animation changes with every step, it will move too quickly. To create the desired effect, you need to change the frame once every 10 steps. That's why we need to override the nextFrame method
    3
    Niedostępne
  • Space Invaders (Part 30/34)

    Games
    Poziom 0, Lekcja 6
    Now we'll teach the boss to shoot. Depending on the animation frame, the boss will shoot from different cannons. We'll also override the kill() method, where we'll set the value of the isAlive field and set the frames of the explosion animation.
    3
    Niedostępne
  • Space Invaders (Part 31/34)

    Games
    Poziom 0, Lekcja 6
    Let's make the boss animate continuously. To do this, we need to give the setAnimatedView method an isLoopAnimation parameter responsible for indicating whether the animation should loop. This parameter is used to properly set the loopAnimation field. If the loopAnimation field is true, the nextFra
    3
    Niedostępne
  • Space Invaders (Part 32/34)

    Games
    Poziom 0, Lekcja 6
    The game is lost not only if the player's ship is destroyed, but also if the enemy fleet reaches the player's ship. To determine the coordinates of the lower edge of the enemy fleet, we'll add a getBottomBorder() method. If all the enemies are destroyed, the player wins. For convenience, we'll add
    3
    Niedostępne
  • Space Invaders (Part 33/34)

    Games
    Poziom 0, Lekcja 6
    At this stage, we'll add scorekeeping to the game. The player gets 15 points for each ordinary ship and 100 points for the boss. It will be most convenient to keep score in the checkHit() method, after reworking it a little. To store the total score, we'll add a score variable in the SpaceInvadersG
    3
    Niedostępne
  • Space Invaders (Part 34/34)

    Games
    Poziom 0, Lekcja 6
    Congratulations! The game is done! Run it and see what happens. If you have time and motivation, you can improve the game by adding some features of your own. For example: - add other types of ships; - change the number of cannons on the ships; - add new types of projectiles; - change the scoring s
    3
    Niedostępne
  • 1
  • ...
  • 107
  • 108
  • 109
Nauka
  • Rejestracja
  • Kurs Java
  • Pomoc w Zadaniach
  • Cennik
  • Projekty Gier
  • Składnia Java
Społeczność
  • Użytkownicy
  • Artykuły
  • Forum
  • Czat
  • Historie Sukcesu
  • Aktywność
Firma
  • O nas
  • Kontakt
  • Opinie
  • Pokój prasowy
  • CodeGym dla EDU
  • FAQ
  • Wsparcie
CodeGym CodeGym to internetowy kurs uczący od podstaw programowania w języku Java. Ten kurs to doskonały sposób na opanowanie języka Java dla początkujących. Zawiera pond 1200 zadań z możliwością natychmiastowej weryfikacji oraz niezbędny zakres teorii na temat podstaw języka Java. Aby pomóc Ci odnieść sukces w nauce, przygotowaliśmy również zestaw elementów motywacyjnych: quizy, projekty programistyczne, artykuły na temat efektywnego uczenia się i kariery programisty Java.
Obserwuj nas
Język interfejsu
Programistą Się Nie Rodzi, Programistą Się Zostaje © 2022 CodeGym
Download App
  • Google Play
  • Huawei AppGallery
  • App Store
MastercardVisa
Programistą Się Nie Rodzi, Programistą Się Zostaje © 2022 CodeGym
This website uses cookies to provide you with personalized service. By using this website, you agree to our use of cookies. If you require more details, please read our Terms and Policy.