|
|
|
@ -5,6 +5,7 @@ import java.lang.reflect.InvocationTargetException; |
|
|
|
|
import sig.RabiClone; |
|
|
|
|
import sig.engine.String; |
|
|
|
|
import sig.engine.objects.Object; |
|
|
|
|
import sig.map.Tile; |
|
|
|
|
|
|
|
|
|
public class SpawnEvent implements Event{ |
|
|
|
|
|
|
|
|
@ -24,7 +25,7 @@ public class SpawnEvent implements Event{ |
|
|
|
|
@Override |
|
|
|
|
public boolean perform(int x, int y) { |
|
|
|
|
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 |
|
|
|
|
| NoSuchMethodException | SecurityException e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|