Buns do not spawn in walls now

Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com>
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
main
unknown 2 years ago
parent 86aaee86cc
commit ad578faad0
  1. 3
      src/sig/events/SpawnEvent.java
  2. 2
      src/sig/objects/enemies/GreenBun.java
  3. 2
      src/sig/objects/enemies/YellowBun.java

@ -5,6 +5,7 @@ import java.lang.reflect.InvocationTargetException;
import sig.RabiClone; import sig.RabiClone;
import sig.engine.String; import sig.engine.String;
import sig.engine.objects.Object; import sig.engine.objects.Object;
import sig.map.Tile;
public class SpawnEvent implements Event{ public class SpawnEvent implements Event{
@ -24,7 +25,7 @@ public class SpawnEvent implements Event{
@Override @Override
public boolean perform(int x, int y) { public boolean perform(int x, int y) {
try { try {
RabiClone.OBJ.add((Object)entity.getDeclaredConstructor(new Class<?>[]{double.class,double.class}).newInstance(x,y)); RabiClone.OBJ.add((Object)entity.getDeclaredConstructor(new Class<?>[]{double.class,double.class}).newInstance(x+Tile.TILE_WIDTH/2,y+Tile.TILE_HEIGHT/2));
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException
| NoSuchMethodException | SecurityException e) { | NoSuchMethodException | SecurityException e) {
e.printStackTrace(); e.printStackTrace();

@ -1,8 +1,6 @@
package sig.objects.enemies; package sig.objects.enemies;
import sig.RabiClone; import sig.RabiClone;
import sig.engine.AnimatedSprite;
import sig.engine.Panel;
import sig.engine.Sprite; import sig.engine.Sprite;
import sig.objects.BunnyGirls; import sig.objects.BunnyGirls;
import sig.objects.actor.PhysicsObject; import sig.objects.actor.PhysicsObject;

@ -1,8 +1,6 @@
package sig.objects.enemies; package sig.objects.enemies;
import sig.RabiClone; import sig.RabiClone;
import sig.engine.AnimatedSprite;
import sig.engine.Panel;
import sig.engine.Sprite; import sig.engine.Sprite;
import sig.objects.BunnyGirls; import sig.objects.BunnyGirls;
import sig.objects.actor.PhysicsObject; import sig.objects.actor.PhysicsObject;

Loading…
Cancel
Save