-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9a9ab4b
commit 36428a4
Showing
7 changed files
with
72 additions
and
16 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package entities; | ||
|
||
import main.Game; | ||
import utilz.LoadSave; | ||
|
||
import java.awt.*; | ||
import java.awt.image.BufferedImage; | ||
|
||
import static utilz.Constants.EnemyConstants.*; | ||
|
||
public class Alien3 extends Enemy { | ||
|
||
// ====================> ATRIBUTOS <==================== | ||
|
||
// ====================> CONTRUCTOR <==================== | ||
public Alien3(float x, float y) { | ||
super(x, y, Alien_WIDTH, Alien_HEIGHT, Alien3); | ||
initHitbox(x, y, (int) (20 * Game.SCALE), (int) (20 * Game.SCALE)); | ||
loadImgs(); | ||
} | ||
|
||
// ====================> GET | SET <==================== | ||
|
||
// ====================> METODOS <==================== | ||
public void draw(Graphics g){ | ||
g.drawImage( | ||
animations[state][getAniIndex()], | ||
(int)(x - xDrawOffset), | ||
(int)(y - yDrawOffset), | ||
Alien_WIDTH, | ||
Alien_HEIGHT, | ||
null); | ||
} | ||
|
||
/** loadImgs() ==> Separa el SpriteSheat y los ubica en una matriz. */ | ||
private void loadImgs() { | ||
animations = new BufferedImage[2][5]; | ||
BufferedImage temp = LoadSave.GetSpritesAtlas(LoadSave.Alien3_ATLAS); | ||
for (int j = 0; j < animations.length; j++) | ||
for (int i = 0; i < animations[j].length; i++) | ||
animations[j][i] = temp.getSubimage(i * Alien_WIDHT_DEFAULT, j * Alien_HEIGHT_DEFAULT, Alien_WIDHT_DEFAULT, Alien_HEIGHT_DEFAULT); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters