setdisplayaspect (0.66)
SetDisplayAspect ( 4.0 / 3.0 )
lives=5
setclearcolor (250,250,250)
happysanta = loadimage ("happysanta.png")
sprite = createsprite (happysanta)
setspritesize (happysanta,20,25)
trees = loadimage ("trees.png")
sprite = createsprite (trees)
setspritesize (trees,50,30)
pausea = loadimage ("pause.png")
sprite = createsprite (pausea)
setspritesize (pausea,10,10)
presenta = loadimage ("present4.png")
sprite = createsprite(presenta)
setspritesize(presenta,100,2)
presentb = loadimage ("present4.png")
sprite = createsprite(presentb)
setspritesize(presentb,100,2)
presentc = loadimage ("present4.png")
sprite = createsprite(presentc)
setspritesize(presentc,100,2)
treesa = loadimage ("trees.png")
sprite = createsprite (treesa)
setspritesize (treesa,50,30)
treesb = loadimage ("trees.png")
sprite = createsprite (treesb)
setspritesize (treesb,50,30)
treesc = loadimage ("trees.png")
sprite = createsprite (treesc)
setspritesize (treesc,50,30)
boxa = loadimage ("box.png")
sprite = createsprite (boxa)
setspritesize (boxa,100,30)
gameover = loadimage ("gameover.png")
sprite = createsprite (gameover)
setspritesize (gameover,0,0)
northpole = loadimage ("northpole.png")
sprite = createsprite (northpole)
setspritesize (northpole,4,15)
helppage = loadimage ("helppagea.png")
sprite = createsprite (helppage)
setspritesize (helppage,0,0)
back = loadimage ("back.png")
sprite = createsprite (back)
setspritesize (back,10,10)
present = loadImage("present1.png")
present2 = loadImage("present2.png")
present3 = loadImage("present3.png")
present4 = loadImage("present4.png")
coal=loadimage ("coal.png")
naughtychild = loadimage ("naughtychild.png")
snow = loadimage ("snow.png")
setspriteangle (presentc,90)
setspriteangle (presentb,90)
setspriteposition (happysanta,10,74)
setspriteposition (presenta,0,99)
setspriteposition (presentb,50,50)
setspriteposition (presentc,-50,50)
setspriteposition (trees,60,60)
setspriteposition (treesa,30,60)
setspriteposition (treesb,0,50)
setspriteposition (treesc,40,40)
setspriteposition (boxa,0,0)
setspriteposition (pausea,90,3)
setspriteposition (northpole,20,40)
setspriteposition (back,130,213)
setspritephysicson (happysanta,3)
setspritephysicson (presenta,3)
setspritedepth (happysanta,1)
setspritedepth (pausea,1)
setspritedepth (helppage,1)
setphysicsgravity (0,24)
setspritecolor (boxa,0,200,250,200)
AddVirtualJoystick ( 1, 86, 84, 15 )
do
print (score)
setprintsize (7)
time = timer()
if time>spawnTime
spawnTime=time+random(3,7)
spr = createSprite(present)
setspritesize (spr,5,5)
setspritedepth (spr,1)
setspritephysicson (spr,2)
setSpritePosition(spr,random(0,100),5)
endif
if time>spawnTime2
spawnTime2=time+random(1,4)
spr2 = createSprite(present2)
setspritesize (spr2,5,5)
setspritedepth (spr2,1)
setspritephysicson (spr2,2)
setSpritePosition(spr2,random(0,100),5)
endif
if time>spawnTime3
spawnTime3=time+random(40,50)
spr3 = createSprite(present3)
setspritesize (spr3,5,5)
setspritedepth (spr3,1)
setspritephysicson (spr3,2)
setSpritePosition(spr3,random(0,100),5)
endif
if time>spawnTime4
spawnTime4=time+random(5,15)
spr4 = createSprite(present4)
setspritesize (spr4,5,5)
setspritedepth (spr4,1)
setspritephysicson (spr4,2)
setSpritePosition(spr4,random(0,100),5)
endif
if time>spawnTime5
spawnTime5=time+random(15,20)
spr5 = createSprite(coal)
setspritesize (spr5,5,5)
setspritedepth (spr5,1)
setspritephysicson (spr5,2)
setSpritePosition(spr5,random(0,100),5)
endif
if time>spawnTime6
spawnTime6=time+random(20,40)
spr6 = createSprite(naughtychild)
setspritesize (spr6,7,15)
setspritedepth (spr6,1)
setspritephysicson (spr6,2)
setSpritePosition(spr6,random(0,100),5)
endif
if time>spawnTime
spawnTime=time+random(1,3)
spr7 = createSprite(snow)
setspritesize (spr7,3,3)
setspritedepth (spr7,1)
setspritephysicson (snow,1)
setSpritePosition(spr7,random(0,100),5)
endif
if lives=0
setspritesize (gameover,100,100)
setspritedepth (gameover,1)
setvirtualjoystickposition (1,120,120)
pause=1
spawntime = 10000
spawntime2 = 10000
spawntime3 = 10000
spawntime4 = 10000
spawntime5 = 10000
spawntime6 = 10000
endif
if getspritecollision (presenta,spr)
lives = lives -1
setspriteposition (spr,120,120)
setspritedepth (spr,0)
endif
if getspritecollision (spr,happysanta)
setspritesize (spr,0,0)
setspriteposition (spr,120,120)
score = score + 10
endif
if getspritecollision (presenta,spr2)
lives = lives -1
setspriteposition (spr2,-120,120)
setspritedepth (spr2,0)
setspritesize (spr2,0,0)
endif
if getspritecollision (spr2,happysanta)
setspritesize (spr2,0,0)
setspriteposition (spr2,120,120)
score = score + 10
endif
if getspritecollision (presenta,spr3)
lives = lives -1
setspriteposition (spr3,120,120)
setspritedepth (spr3,0)
endif
if getspritecollision (spr3,happysanta)
setspritesize (spr3,0,0)
setspriteposition (spr3,120,120)
score = score + 30
endif
if getspritecollision (presenta,spr4)
lives = lives -1
setspriteposition (spr4,120,120)
setspritedepth (spr4,0)
endif
if getspritecollision (spr4,happysanta)
setspritesize (spr4,0,0)
setspriteposition (spr4,120,120)
score = score + 10
endif
if getspritecollision (spr5,happysanta)
setspritesize (spr5,0,0)
setspriteposition (spr5,120,120)
score = score - 30
endif
if getspritecollision (presenta,spr5)
setspriteposition (spr5,120,120)
setspritedepth (spr5,0)
endif
if getspritecollision (spr6,happysanta)
setspritesize (spr6,0,0)
setspriteposition (spr6,120,120)
score = score - 50
endif
if getspritecollision (presenta,spr6)
setspriteposition (spr6,120,120)
setspritedepth (spr6,0)
endif
if score = 300
lives = lives+1
endif
if score = 700
lives = lives+1
endif
if score = 1000
lives = lives+1
endif
if score = 1500
lives = lives+1
endif
if getspritecollision (presentc,happysanta)
setspriteposition (happysanta,2,74)
endif
if GetSpriteCollision(presentb, happysanta)
setspriteposition (happysanta,80,74)
endif
joystickX# = GetVirtualJoystickX ( 1 )
SetSpritePosition ( happysanta, GetSpriteX ( happysanta ) + ( joystickX# / 1), GetSpriteY ( happysanta ) + ( joystickY# / 1) )
if GetPointerState()
x# = GetPointerX()
y# = GetPointerY()
if GetSpriteHit(x#, y#) = pausea
SetSpriteImage(pausea, pauseImg)
else
SetSpriteImage(pausea, pauseImg)
endif
endif
if GetPointerReleased()
x# = GetPointerX()
y# = GetPointerY()
if GetSpriteHit(x#, y#) = pausea
SetSpriteImage(pausea, pauseImg)
pause=1
setspritedepth (helppage,1)
setspritedepth (back,1)
setspritesize (helppage,100,100)
setspriteposition (pausea,0,120)
setvirtualjoystickposition (1,120,100)
setspriteposition (back,3,3)
spawntime = 10000
spawntime2 = 10000
spawntime3 = 10000
spawntime4 = 10000
spawntime5 = 10000
spawntime6 = 10000
endif
endif
if GetPointerState()
x# = GetPointerX()
y# = GetPointerY()
if GetSpriteHit(x#, y#) = back
SetSpriteImage(back, backImg)
endif
endif
if GetPointerReleased()
x# = GetPointerX()
y# = GetPointerY()
if GetSpriteHit(x#, y#) = back
SetSpriteImage(back, backImg)
pause=0
setspritedepth (pausea,1)
setspriteposition (pausea,90,3)
setspritecolor (back,0,0,0,0)
setspritesize (helppage,0,0)
setvirtualjoystickposition (1,90, 88)
endif
endif
if pause =1
stepPhysics(0)
endif
Sync()
loop
kirtnicholls