🎉Component
maybe a character, maybe a box maybe, a menu page
Let's just define an example
"*" at the beginning indicates that it must be entered
const player1 = new Component({
name: "player1",//*Component name
inscreen: true,//prevents exiting the screen
physic: {
status: true//Adds physics
},
position: {//*starting position
x: 0,
y: 0,
},
scale: {//*how big will it be
x: 100,
y: 180,
},
color:"red",//optional color
notick:false//Turns off physics and collision rendering optimization
});
🎉🎉🎉 Yes we created a new object
Update
player1.update({
physic:{
x:5,
y:20
}
})
//or
updateData({
name:"player1",
physic:{
x:5,
y:20
}
})
Get
console.log(player1.get())
console.log(getData("player1"))
//Example
console.log(
player1.get().physic.x
)
Remove
player1.remove()
removeData("player1")
Last updated