Change Camera - Quick Engine
Hey, I was using quick engine but I was wondering if there was a way to change the camera position so I can make a side scroller.
Hey, I was using quick engine but I was wondering if there was a way to change the camera position so I can make a side scroller.
"Quick" has a field with a "camera" object. Set the x and y fields to the values you want to be centered on the screen.
update = function()
Quick.camera.x = player.x
Quick.camera.y = player.y
end
If you have a player and you want the camera to follow him .
Also for smooth camera motion, you can use:
Quick.camera.move( player.x, player.y )
ty,but can i make the camera zoom in or out???
in the Quick engine, the zoom variable is responsible for zooming in.
More specifically, it enlarges/reduces the drawn Sprite.
update = function()
// ......
Quick.camera.move( sind( system.time()/10)*50, cosd( system.time()/20)*25 )
Quick.camera.zoom = sind( system.time()/60)/2 +1
end
add this code to the Quick Engine
demo in the update() function (at the end of this function)