/** * Add a GameObject to the game. New GameObjects will become active in the next pass of the * gameloop. <br> * Layerposition may not work very well as yet, still under construction.<br> * * @param gameObject The GameObject that will be added to the game. Should have either GameObject * or MovableGameObject as it's parent. * @param x The X spawnlocation when this object is created * @param y The Y spawnlocation when this object is created * @param layerposition The layerposition when this object is drawed. <b>Between 0 and 1 (float). * </b> 1 front, 0 back */ public final void addGameObject(GameObject gameObject, int x, int y, float layerposition) { gameObject.setStartPosition(x, y); gameObject.jumpToStartPosition(); gameObject.setDepth(layerposition); newItems.add(gameObject); }
/** * Add a GameObject to the game. New GameObjects will become active in the next pass of the * gameloop.<br> * * @param gameObject The GameObject that will be added to the game. Should have either GameObject * or MovableGameObject as it's parent. * @param x The X spawnlocation when this object is created * @param y The Y spawnlocation when this object is created */ public final void addGameObject(GameObject gameObject, int x, int y) { gameObject.setStartPosition(x, y); gameObject.jumpToStartPosition(); newItems.add(gameObject); }