diff --git a/GameEngine/src/main/java/gameEngine/entites/gameComponents/CopyEntity.java b/GameEngine/src/main/java/gameEngine/entites/gameComponents/CopyEntity.java new file mode 100644 index 0000000..b91144b --- /dev/null +++ b/GameEngine/src/main/java/gameEngine/entites/gameComponents/CopyEntity.java @@ -0,0 +1,21 @@ +package gameEngine.entites.gameComponents; + +import gameEngine.entites.Entity; +import gameEngine.entites.GameObject; +import gameEngine.input.Input; +import gameEngine.views.Window; + +import static org.lwjgl.glfw.GLFW.GLFW_KEY_G; + +public class CopyEntity extends GameComponent{ + private Entity entity; + public CopyEntity(Entity entity){ + this.entity = entity; + } + + public void update() { + if(Input.GetKeyDown(GLFW_KEY_G)){ + Window.currentScene.Instantiate((GameObject) entity); + } + } +}