-
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
ceef5f9
commit 10684e1
Showing
6 changed files
with
54 additions
and
3 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 Alien4 extends Enemy { | ||
|
||
// ====================> ATRIBUTOS <==================== | ||
|
||
// ====================> CONTRUCTOR <==================== | ||
public Alien4(float x, float y) { | ||
super(x, y, Alien_WIDTH, Alien_HEIGHT, Alien4); | ||
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.Alien4_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