📕Background
Color
Engine_backgroundcolor = "red"//paints the background red
Engine_backgroundcolor = false//does not paint the background
Animation
<div id="backgrounds">
<img id="image-1" src="./test1.png" style="display:none">
<img id="image-2" src="./test2.png" style="display:none">
</div>
switches to automatic animation in div with "backgrounds" id in ingame.html
🔃OnloadMap system
Text and Component
backgroundmap({
dx:500,dy:500,//corner side size
x:50,y:50//your position in the image
})
{
backgroundposition:true, //if you add this the object will move when the background moves
position:Cbacground(10,10)//Adjusts according to the resolution of the image (x,y)
}
If you want the Cbackground() to run smoothly, put it under editdisplay()
After using backgroundmap() starts Cbackground() working
inscreen and physics must be turned off
Move example
keypress = (key) => {
if (key === "W" || key == "ARROWUP") {
backgroundmap({ y:"-8" });
} else if (key === "S" || key == "ARROWDOWN") {
backgroundmap({ y: "+8" });
} else if (key === "A" || key == "ARROWLEFT") {
backgroundmap({ x: "-8" });
} else if (key === "D" || key == "ARROWRIGHT") {
backgroundmap({ x: "+8" });
}
};

Image
<div id="backgrounds">
<img id="image-1" src="./test1.png" style="display:none">
</div>
You only need to enter one picture in this section
Last updated