|
|
@ -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(); |
|
|
|