
// Project: Parallax
// Created: 2017-11-03

#include "../_libs/ScraggleEngine.agc"
#include "../_libs/parallax.agc"


SetDisplay(1920, 1080, "Parallax Test", RES_VIRTUAL, ORIENT_LANDSCAPE, FALSE)


frnt = CreateSprite(LoadImage("front.png"))
grnd = CreateSprite(LoadImage("ground.png"))
trees = CreateSprite(LoadImage("backdrop.png"))
far = CreateSprite(LoadImage("rear.png"))
backdrop = CreateSprite(LoadImage("clouds3.png"))

pxCreateLayer(frnt, -1, display.h)
pxCreateLayer(grnd, -1, GetSpriteHeight(grnd))
pxCreateLayer(trees, -1, display.h)
pxCreateLayer(far, -1, display.h)
pxCreateLayer(backdrop, display.w, display.h)

pxSetLayerY(1, display.b - GetSpriteHeight(grnd))

pxSetLayerSpeed(0, 5)
pxSetRelativeSpeed(0.5)


do
	if GetRawKeyPressed(KEY_LEFT)
		pxSetDirection(-1)
	endif
	if GetRawKeyPressed(KEY_RIGHT)
		pxSetDirection(1)
	endif

	pxUpdate()
    Sync()
loop

