Merge remote-tracking branch 'origin/master'

master
John 2022-06-09 14:18:29 -04:00
commit 4dd4d78103
5 changed files with 26 additions and 11 deletions

View File

@ -9,8 +9,8 @@ sssssssssssssssssd
sssssssssssssssssd qe qe sssssssssssssssssd qe qe
sssssssssssssssssd ad ! ad sssssssssssssssssd ad ! ad
sssssssssssssssssd qwe qwe atwwwrd qwwwwwwellllqwwwwwwwe sssssssssssssssssd qwe qwe atwwwrd qwwwwwwellllqwwwwwwwe
sssssssssssssssssd asd asd zxxxxxc zxxxxxxxwwwwxxxxxxxxc sssssssssssssssssd asd asd zxxxxxc zxxxxxxxllllxxxxxxxxc
sssssssssssssssssd 1 zxc zxc vvvvvvvvvvvvvvvvvvvvv sssssssssssssssssd 1 zxc zxc vvvvvvvvwwwwvvvvvvvvv
sssssssssssssssssd qe vvvvvvvvvvvvvvvvvvvvv sssssssssssssssssd qe vvvvvvvvvvvvvvvvvvvvv
sssssssssssssssssd ad qwwwwwwwwe vvvvvvvvvvvvvvvvvvvvv sssssssssssssssssd ad qwwwwwwwwe vvvvvvvvvvvvvvvvvvvvv
sssssssssssssssssd ad qrsssssssstwe vvvvvvvvvvvvvvvvvvvvv sssssssssssssssssd ad qrsssssssstwe vvvvvvvvvvvvvvvvvvvvv

View File

@ -6,9 +6,9 @@ sssssssssssssssssd
sssssssssssssssssd 1 1 1 1 1 sssssssssssssssssd 1 1 1 1 1
sssssssssssssssssd 1 sssssssssssssssssd 1
sssssssssssssssssd sssssssssssssssssd
sssssssssssssssssd sssssssssssssssssd ll
sssssssssssssssssd sssssssssssssssssd llllll
sssssssssssssssssd qwe qwe sssssssssssssssssd l qwe qwe
sssssssssssssssssd asd asd sssssssssssssssssd asd asd
sssssssssssssssssd bbb 1 zxc zxc sssssssssssssssssd bbb 1 zxc zxc
sssssssssssssssssdbbbbbbbbbbbbbbbbbbbbbbb sssssssssssssssssdbbbbbbbbbbbbbbbbbbbbbbb

View File

@ -91,8 +91,10 @@ public class MapReader {
} else if(file.charAt(i)=='l'){ } else if(file.charAt(i)=='l'){
newTile("img/tiles/terrain/lava.png"); newTile("img/tiles/terrain/lava.png");
GamePanel.map[x][y].kills = true; GamePanel.map[x][y].kills = true;
if(y>0&&GamePanel.map[x][y-1]==null) {
GamePanel.particleTiles.add(GamePanel.map[x][y]); GamePanel.particleTiles.add(GamePanel.map[x][y]);
} }
}
x+=1; x+=1;
} }
} }

View File

@ -199,11 +199,13 @@ public class Player extends GenericSprite {
y = LevelManager.ySpawn; y = LevelManager.ySpawn;
} }
public void mousePressed(MouseEvent e){ public void mousePressed(MouseEvent e) {
int xx = e.getX(); int xx = e.getX();
int yy = e.getY(); int yy = e.getY();
GamePanel.bombs.add(new StickyBomb(GamePanel.player.x+GamePanel.camera.x,GamePanel.player.y,35, if (GamePanel.bombs.size() < 3) {
(xx-GamePanel.player.x)/20, (yy-GamePanel.player.y)/10, GamePanel.bomb, GamePanel.explosionArray)); GamePanel.bombs.add(new StickyBomb(GamePanel.player.x + GamePanel.camera.x, GamePanel.player.y, 25,
(xx - GamePanel.player.x) / 20, (yy - GamePanel.player.y) / 10, GamePanel.bomb, GamePanel.explosionArray));
}
} }
public void addParticle(int x) throws IOException { public void addParticle(int x) throws IOException {
if(GlobalState.randInt(1,3)==3) { if(GlobalState.randInt(1,3)==3) {

View File

@ -5,6 +5,8 @@ import java.awt.image.BufferedImage;
public class StickyBomb extends GenericSprite{ public class StickyBomb extends GenericSprite{
public int length; public int length;
public static final int spriteLength = 35;
public int xVelocity; public int xVelocity;
public int yVelocity; public int yVelocity;
public boolean isMove; public boolean isMove;
@ -51,7 +53,16 @@ public class StickyBomb extends GenericSprite{
} }
GamePanel.player.capSpeed(); GamePanel.player.capSpeed();
alive = false; alive = false;
for(int i=0; i<GamePanel.enemy.size(); i++){
double disX = GamePanel.enemy.get(i).x+GamePanel.enemy.get(i).npcWidth/2 - (x+length/2);
double disY = GamePanel.enemy.get(i).y+GamePanel.enemy.get(i).npcHeight/2 - (y+length/2);
double eHypo = Math.sqrt(disX*disX+disY*disY);
if(eHypo<200){
GamePanel.enemy.remove(i);
} }
}
}
public void move(){ public void move(){
update(); update();
if(fuse>0) { if(fuse>0) {
@ -113,10 +124,10 @@ public class StickyBomb extends GenericSprite{
explosionCounter -= 2; explosionCounter -= 2;
} }
if(alive) { if(alive) {
g.drawImage(sprite, x - GamePanel.camera.x, y, length, length, null); g.drawImage(sprite, x - GamePanel.camera.x - (spriteLength-length)/2, y - (spriteLength-length)/2, spriteLength, spriteLength, null);
} else if (explosionPixel < explosionSpriteArray.length - 1) { } else if (explosionPixel < explosionSpriteArray.length - 1) {
g.drawImage(explosionSpriteArray[explosionPixel], x - GamePanel.camera.x - 10*explosionPixel, g.drawImage(explosionSpriteArray[explosionPixel], x - GamePanel.camera.x - 10*explosionPixel,
y-10*explosionPixel, length+10*explosionPixel, length+10*explosionPixel, null); y-10*explosionPixel, spriteLength+10*explosionPixel, spriteLength+10*explosionPixel, null);
explosionCounter += 1; explosionCounter += 1;
} else { } else {
erase = true; erase = true;