@@ -31,7 +31,7 @@ export const main = async (options: IRunOptions) => {
3131
3232 await app . init ( options ) ;
3333
34- const ball = ecsLibrary . createEntity ( ) ;
34+ const ball = ecsLibrary . spawnEntity ( ) ;
3535 ecsLibrary . addComponent ( ball , new Velocity ( 0.04 , 0 ) ) ;
3636 ecsLibrary . addComponent ( ball , new Position ( 0.5 , 0 ) ) ;
3737 ecsLibrary . addComponent ( ball , new Bounce ( ) ) ;
@@ -45,7 +45,7 @@ export const main = async (options: IRunOptions) => {
4545 ) ,
4646 ) ;
4747
48- const bg = ecsLibrary . createEntity ( ) ;
48+ const bg = ecsLibrary . spawnEntity ( ) ;
4949 ecsLibrary . addComponent (
5050 bg ,
5151 new RectangleComponent (
@@ -57,7 +57,7 @@ export const main = async (options: IRunOptions) => {
5757 ) ,
5858 ) ;
5959
60- const topWall = ecsLibrary . createEntity ( ) ;
60+ const topWall = ecsLibrary . spawnEntity ( ) ;
6161 ecsLibrary . addComponent (
6262 topWall ,
6363 new RectangleComponent (
@@ -69,7 +69,7 @@ export const main = async (options: IRunOptions) => {
6969 ecsLibrary . addComponent ( topWall , new Position ( - 1.8 , 0.91 ) ) ;
7070 ecsLibrary . addComponent ( topWall , new Hitbox ( 3.6 , 0.1 ) ) ;
7171
72- const botWall = ecsLibrary . createEntity ( ) ;
72+ const botWall = ecsLibrary . spawnEntity ( ) ;
7373 ecsLibrary . addComponent (
7474 botWall ,
7575 new RectangleComponent (
@@ -81,7 +81,7 @@ export const main = async (options: IRunOptions) => {
8181 ecsLibrary . addComponent ( botWall , new Position ( - 1.8 , - 1 ) ) ;
8282 ecsLibrary . addComponent ( botWall , new Hitbox ( 3.6 , 0.1 ) ) ;
8383
84- const player1 = ecsLibrary . createEntity ( ) ;
84+ const player1 = ecsLibrary . spawnEntity ( ) ;
8585 ecsLibrary . addComponent ( player1 , new Position ( - 1.8 , - 0.3 ) ) ;
8686 ecsLibrary . addComponent ( player1 , new Velocity ( 0 , 0.1 ) ) ;
8787 ecsLibrary . addComponent ( player1 , new Hitbox ( 0.1 , 0.5 ) ) ;
@@ -95,7 +95,7 @@ export const main = async (options: IRunOptions) => {
9595 ) ,
9696 ) ;
9797
98- const player2 = ecsLibrary . createEntity ( ) ;
98+ const player2 = ecsLibrary . spawnEntity ( ) ;
9999 ecsLibrary . addComponent ( player2 , new Position ( 1.7 , - 0.3 ) ) ;
100100 ecsLibrary . addComponent ( player2 , new Velocity ( 0 , 0.1 ) ) ;
101101 ecsLibrary . addComponent ( player2 , new Hitbox ( 0.1 , 0.5 ) ) ;
0 commit comments