Add in spawners that can create things. Make it so rendered objects will render with the camera view
Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com> Co-authored-by: sigonasr2 <sigonasr2@gmail.com>main
parent
aa41f52bbd
commit
cb04afe469
@ -0,0 +1,8 @@ |
|||||||
|
package sig.events; |
||||||
|
|
||||||
|
import sig.engine.String; |
||||||
|
|
||||||
|
public interface Event{ |
||||||
|
public String getDescription(); |
||||||
|
public void perform(int x, int y); |
||||||
|
} |
@ -0,0 +1,34 @@ |
|||||||
|
package sig.events; |
||||||
|
|
||||||
|
import java.lang.reflect.InvocationTargetException; |
||||||
|
|
||||||
|
import sig.RabiClone; |
||||||
|
import sig.engine.String; |
||||||
|
import sig.engine.objects.Object; |
||||||
|
|
||||||
|
public class SpawnEvent implements Event{ |
||||||
|
|
||||||
|
Class<?> entity; |
||||||
|
String description; |
||||||
|
|
||||||
|
public SpawnEvent(java.lang.String description,Class<?> o) { |
||||||
|
this.entity=o; |
||||||
|
this.description=new String(description); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String getDescription() { |
||||||
|
return description; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void perform(int x, int y) { |
||||||
|
try { |
||||||
|
RabiClone.OBJ.add((Object)entity.getDeclaredConstructor(new Class<?>[]{Double.class,Double.class}).newInstance(x,y)); |
||||||
|
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException |
||||||
|
| NoSuchMethodException | SecurityException e) { |
||||||
|
e.printStackTrace(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,5 @@ |
|||||||
|
package sig.objects.actor; |
||||||
|
|
||||||
|
public interface RenderedObject { |
||||||
|
|
||||||
|
} |
Loading…
Reference in new issue