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 ad ! ad
sssssssssssssssssd qwe qwe atwwwrd qwwwwwwellllqwwwwwwwe
sssssssssssssssssd asd asd zxxxxxc zxxxxxxxwwwwxxxxxxxxc
sssssssssssssssssd 1 zxc zxc vvvvvvvvvvvvvvvvvvvvv
sssssssssssssssssd asd asd zxxxxxc zxxxxxxxllllxxxxxxxxc
sssssssssssssssssd 1 zxc zxc vvvvvvvvwwwwvvvvvvvvv
sssssssssssssssssd qe vvvvvvvvvvvvvvvvvvvvv
sssssssssssssssssd ad qwwwwwwwwe vvvvvvvvvvvvvvvvvvvvv
sssssssssssssssssd ad qrsssssssstwe vvvvvvvvvvvvvvvvvvvvv

View File

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

View File

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

View File

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

View File

@ -5,6 +5,8 @@ import java.awt.image.BufferedImage;
public class StickyBomb extends GenericSprite{
public int length;
public static final int spriteLength = 35;
public int xVelocity;
public int yVelocity;
public boolean isMove;
@ -51,7 +53,16 @@ public class StickyBomb extends GenericSprite{
}
GamePanel.player.capSpeed();
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(){
update();
if(fuse>0) {
@ -113,10 +124,10 @@ public class StickyBomb extends GenericSprite{
explosionCounter -= 2;
}
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) {
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;
} else {
erase = true;