1
This commit is contained in:
@@ -3,6 +3,8 @@ package com.zombie.game.model;
|
||||
import lombok.Getter;
|
||||
import java.util.*;
|
||||
|
||||
import static com.zombie.game.model.Constants.*;
|
||||
|
||||
/**
|
||||
* 子弹/投掷物类
|
||||
*
|
||||
@@ -123,7 +125,9 @@ public class Bullet {
|
||||
|
||||
int gx = (int) Math.floor(x);
|
||||
int gy = (int) Math.floor(y);
|
||||
if (map.isWall(gx, gy)) return false;
|
||||
// 只有碰到静态墙壁才销毁子弹,碰到坚果墙体让碰撞检测处理
|
||||
Wall wall = map.getWall(gx, gy);
|
||||
if (wall instanceof StaticWall) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user