I bashed this out its not great code but I thought by now AppGameKit would be more or less bug free.
It worked when I used the online compiler for android but with no sound.
Then I changed the way the screen scrolled from moving the images to this, where u offset the screen.
Now it does not work at all.
Very frustrating.
Can any1 help me with identifying the problem.?
Sound never works on android it works fine in windows.
I have a valid key and password, like I say I have program that I have compiled that do run.-With no sound!
No sound,no sound, no sound arrgghhhhh!
In this code I only show sprites as they are du to show on screen
I update the screen offset after a set time.
When you move up or down the math slows the whole thing down, I dont think the float math is upto scratch and without it I have to improvise a tacky system that will turn nice anologe into less troublesome decimals like 0.10 0.25 0.50 0.75.
Im sure programming the spectrum many years ago was faster.
I can program I wrote some stuff in 2006 with DBPro
https://www.youtube.com/user/Brett4it/videos
The best thing I wrote with it was this
https://www.youtube.com/watch?v=FCkPkASQ5Y8&list=UUkepuWc2nUQq2rI3IlUbacw
If any1 knows the tricks to get the best perfomance and knows a list of commands that couse the android crash situ please tell me here or send email.
Thank you!. Also My E-mail foldingcircles@gmail.com
//Dragon Dav 29/7/2014
//By Folding-Circles Brett Palmer-www.brettpalmergroup.webs.com
//To View it working on pc
//https://www.youtube.com/watch?v=9MJxLqhmuWc
global debug as integer
//1 = test mode
//not 1 = normal mode
debug = 0
//Ver B 09
global scrollviscounter as integer
global vismax as integer
vismax = 3000
global scrollpersync = 50
SetVirtualResolution(400, 400)
SetOrientationAllowed( 0, 0, 1, 1 )
SetTransitionMode( 1 )
SetSyncRate( 30, 0)
SetWindowTitle("Dragon Dave. Can u leed him out of the Cave?")
//Setup Screen Format
SetViewZoomMode( 0 )
SetClearColor(0,0,0)
SetBorderColor(0,0,0)
SetPrintColor(155,250,10)
SetPrintSize(7)
SetPrintSpacing(0)
ClearScreen()
global frametime# as float
global timelast# as float
frametime# = timer()-timelast#
global startspd# = 5.0
global scrollspd# as float
global gatherspeed# = 10.0
global topspd# = startspd#
scrollspd# = startspd#
global missilespeed# as float
missilespeed# = 350.0
//Screen Scroll Speed Contrfol Vars
global scrolldivspd# as float
//location
global scrollspd as float
scrollspd = 0.0
global speedfortime# as float
speedfortime# = timer()
global timebeforespeed# as float
timebeforespeed# = 0.010
scrolldivspd# = 10.0
global screenscrollx# as float
global extraspeedx# as float
global extraspeedxinc# as float
global useextraspeed as integer
//Store Device used //device$ = string GetDeviceName()
global device$ as string
global sensivity as integer
sensivity = 4
global difficulty as integer
difficulty = 2
//not needed maybe?!
global controlsensivity# as float
controlsensivity# = sensivity +0.0
//Takeoff control
global takeofftimeto# as float
takeofftimeto# = timer()+ 0.0
//main menu screen
global menuscreen as integer
menuscreen = createsprite(loadimage("menu/dragon-Main2.png"))
setspritevisible(menuscreen,0)
setspritesize(menuscreen,400,400)
//dynamic
global hasgravity = 2
global screenx# as float
type depthstype
player as integer
missile as integer
background as integer
top as integer
bottum as integer
text as integer
score as integer
stats as integer
ice as integer
overlayblack as integer
overlayred as integer
back as integer
endtype
global depthsys as depthstype
depthsys.back = 999
depthsys.background = 990
depthsys.top = 989
depthsys.bottum = 989
depthsys.missile = 7
depthsys.player = 6
depthsys.ice = 6
depthsys.score = 5
depthsys.text = 4
depthsys.stats = 4
depthsys.overlayblack = 3
depthsys.overlayred = 2
//Friction
//SetSpritePhysicsFriction( iSpriteIndex, friction )
global cloudoffsetx# as float
global cloudoffsety# as float
global dim clouds[4] as integer
clouds[1] = createsprite(loadimage("clouds/400.png"))
clouds[2] = createsprite(loadimage("clouds/400.png"))
clouds[3] = createsprite(loadimage("clouds/400.png"))
clouds[4] = createsprite(loadimage("clouds/400.png"))
//setup for cheap scroll texture sys
setdefaultwrapu(1)
//setdefaultwrapu(clouds[1],1)
SetimageWrapV(clouds[1],1 )
SetImageWrapU(clouds[1],1 )
//setdefaultwrapu(clouds[2],1)
SetImageWrapV(clouds[2],1 )
SetImageWrapU(clouds[2],1 )
//setdefaultwrapu(clouds[3],1)
SetImageWrapV(clouds[3],1 )
SetImageWrapU(clouds[3],1 )
//setdefaultwrapu(clouds[4],1)
SetImageWrapV(clouds[4],1 )
SetImageWrapU(clouds[4],1 )
setspritedepth(clouds[1],depthsys.player-1)
setspritedepth(clouds[2],depthsys.player+1)
setspritedepth(clouds[1],depthsys.player-1)
setspritedepth(clouds[2],depthsys.player+1)
ox# =getspritewidth(clouds[1])
oy# =getspriteheight(clouds[1])
sw = getspritewidth(clouds[1])
global cloudsizex# = ox#
global cloudsizey# = oy#
//Hide Clouds
setspritevisible(clouds[1],0)
setspritevisible(clouds[2],0)
setspritevisible(clouds[3],0)
setspritevisible(clouds[4],0)
setspriteposition(clouds[1],0,0)
setspriteposition(clouds[2],sw,0)
setspriteposition(clouds[3],0,0)
setspriteposition(clouds[4],sw,0)
FixSpriteToScreen(clouds[1],1)
FixSpriteToScreen(clouds[1],1)
FixSpriteToScreen(clouds[1],1)
FixSpriteToScreen(clouds[1],1)
setspritecoloralpha(clouds[1],140)
setspritecoloralpha(clouds[2],140)
setspritecoloralpha(clouds[3],140)
setspritecoloralpha(clouds[4],140)
//Particlefx
type particletype
x# as float
y# as float
id as integer
active as integer
color as integer
endtype
loadparticle()
initphysics()
if debug = 1 then SetPhysicsDebugOn()
// // use a new font for the default text
// defaultfontimage = LoadImage ( "text/ascii.png" )
// SetTextDefaultFontImage ( defaultfontimage )
type illtype
id as integer
offx# as float
offy# as float
active as integer
coltype as integer
endtype
type flytype
uptime# as float
downtime# as float
coasttime# as float
joyup as integer
joydown as integer
joycenter as integer
endtype
global flyalter as flytype
global playerx# as float
global playery# as float
playerx# = 220.0
playery# = 120.0
//Music
global dim music[10] as integer
music[1] = loadmusic("sounds/cavemusic.mp3")
//Attack Sound system allows each sound to play without interuption.
global attsnds = 6
global dim attacksound[attsnds] as integer
global attacksoundcounter as integer
for attacksoundcounter = 1 to attsnds
attacksound[attacksoundcounter] = loadsound("sounds/attack.wav")
next attacksoundcounter
attacksoundcounter = 1
//Sounds
global mvolume as integer
mvolume = 15
global svolume as integer
svolume = 66
global dim sound[100] as integer
//set sound ids
for s = 1 to 100
sound[s] = s
next s
//Not sure how to ref sounds>see how many we get!
sound[1] = loadsound("sounds/dragon.wav")
global rore = 1
playsound(sound[1])
sound[2] = loadsound("sounds/flap1.wav")
global flap = 2
//Charging Sound
global charge as integer
charge = loadsound("sounds/charge.wav")
// display a Logo(Big) FOLDING Circles Lightted text logo(old Website)
if GetFileExists("splash.png") = 1
bd = CreateSprite ( LoadImage ( "splash.png" ) )
SetSpriteSize ( bd, 100, 10 )
endif
if GetFileExists("dragondave.png") = 1
bd = CreateSprite ( LoadImage ( "dragondave.png" ) )
SetSpriteSize ( bd, 400, 400 )
endif
ResetTimer()
if debug = 1 then Print( "LOADING.")
sync()
type bg
x as integer
y as integer
id as integer
frame as integer
last as integer
timeto# as float
timelast as integer
active as integer
endtype
//dragon im
global im as integer
global dim dragonframes[3,9] as bg
global walk = 1
global fly = 2
global land = 3
loaddragon()
//Joystick
global joyx# as float
global joyy# as float
//Ice Type
type ice
id as integer
dat as integer
chargeneeded# as float
x# as float
y# as float
x as integer
y as integer
active as integer
gravity as integer
endtype
type target
x# as float
y# as float
x as integer
y as integer
soundid as integer
show as integer
active as integer
chargeneeded# as float
id as integer
endtype
type m
x# as float
y# as float
x as integer
y as integer
frame as integer
T as integer
t# as float
soundid as integer
show as integer
active as integer
charge# as float
id as integer
ang# as float
dirx# as float
diry# as float
endtype
//Ice
global icepart as integer
global wallgap as integer
wallgap = 500
//Level
global levellength = 100
global cavesize = 10
global dim gaps[levellength,cavesize] as ice
//Mesure
global distancemeter as integer
global distancecent as integer
//Time
global T# as float
t# = timer()
distancemeter = 0
distancecent = 0
//Dragon Control Vars
global flywalk as integer
flywalk=2
global startheight# as float
global takeoffspd# as float
takeoffspd# = 45
//Ground Level
global groundlevel# as float
groundlevel# = 284.0
//Scrolling Control Vars
global backdropoffset as integer
backdropoffset = 0
global backgroundy = 0
global floory = 354
global ceily = 0
global dim floorarray[3000] as bg
global dim ceilarray[3000] as bg
global backdroparraysize = 9000
global rep as integer
global dim backdrop[backdroparraysize] as bg
for bdidreset = 1 to backdroparraysize
backdrop[bdidreset].id = bdidreset+100
next bdidreset
//Buggy!
useextraspeed = 0
extraspeedxinc# = 3.0
//SetViewOffset ( 0.0, y# - 50 )
//integer GetMilliseconds()
//GetViewZoom
//FixSpriteToScreen
type nesttype
id as integer
x# as float
y# as float
active as integer
endtype
global nest as nesttype
nest.id = CreateSprite ( LoadImage ( "nest/nest.png" ) )
setspritevisible(nest.id,0)
setspritedepth(nest.id,depthsys.player+1)
createlev()
menu()
showjoystick()
//Hide Dragon Front Page
setspritevisible(bd,0)
//Fire Power
global fp = 50
global dim targetcount[fp] as target
global dim missile[fp] as m
//Reset Missiles
for a = 1 to fp
targetcount[a].show = 0
targetcount[a].active = 0
targetcount[a].x = -100
targetcount[a].y = -100
targetcount[a].x# = -100.0
targetcount[a].y# = -100.0
targetcount[a].chargeneeded# =1.0
next a
type button
held as integer
timepressed# as float
released as integer
endtype
//Player Fire Control System
global buttona as button
global buttonb as button
//Weapon Power Level Vars
global playerweponlevel as integer
global firevelocity# as float
loadweapons()
//Roar
playsound(1)
SetSoundSystemVolume( svolume )
setmusicsystemvolume( mvolume )
global incontrol as integer
incontrol = 0
///////-Prep-Main-/////////////
playmusic (music[1])
stopsound(charge)
//Position dragon at certain level to start in walking mode
//CPU controls players take-off
playerx# = 45.0
playery# = groundlevel#+14
flyalter.uptime# = 0.07
flyalter.coasttime# = 0.12
flyalter.downtime# = 0.15
createillutionblocks()
//Gradients
//Black
global screengradblack as integer
screengradblack = createsprite(loadimage("gradients/screen grad.png"))
setspritevisible(screengradblack,0)
setspritetransparency(screengradblack,1)
setspritedepth(screengradblack,depthsys.overlayblack)
setspritecoloralpha(screengradblack,105)
setspriteposition(screengradblack,0,0)
FixSpriteToScreen(screengradblack,1)
//Red
global screengrad as integer
screengrad = createsprite(loadimage("gradients/screen grad small.png"))
setspritevisible(screengrad,0)
setspritetransparency(screengrad,1)
setspritedepth(screengrad,depthsys.overlayred)
setspritecolor(screengrad,255,30,30,90)
setspritecoloralpha(screengrad,100)
setspriteposition(screengrad,0,0)
FixSpriteToScreen(screengrad,1)
//Effects gravity
SetViewOffset( 0,00.1 )
global gravity# as float
gravity# = 0.5
///////////////////Main/////////////
setspritevisible(screengrad,1)
setspritevisible(screengradblack,1)
lightchange = 1
light = 50
global wallcount as integer
wallcount = 0
initclouds()
while distancemeter <200
controlclouds()
showdistance()
updateT()
controlplayer()
controliceblast()
if debug = 1 then showdebug()
controlsensitivity()
//Light fx Cheap
if random(0,5) = 1
inc light,lightchange
if light >50
lightchange=-lightchange
light = 50
endif
if light <40
lightchange=-lightchange
light = 40
endif
flicker(light)
endif
sync()
endwhile
//Show credits
/////////////Main End////////////////
//END//
end
function showdistance()
print("")
scrollspd = SCREENSCROLLX#
print ("DISTANCE: CM="+str(distancecent)+" METRES="+str(distancemeter) + " SCREENX#:"+str(screenx#) +" FPS="+str(ScreenFPS() ) )
if distancemeter > 180
print ("")
print ("")
print ("")
print ("")
print ("")
print ("")
print ("")
print ("")
print ("")
print ("")
print ("")
print ("")
print ("")
print ("")
print ("")
print ("")
print ("")
print ("")
print (" T H E E N D")
Print ("")
endif
endfunction
function showdebug()
print ("T RUNNING:"+str(T#)+" F TIME:="+str(frametime#)+" FPS="+str(ScreenFPS()))
print ("PLAYER IN-CONTROL="+str(incontrol))
print ("X:="+str(playerx#)+" Y:="+str(playery#) )
print ("GRAVITY#"+str(gravity#)+" VC-SYS:"+str(scrollviscounter))
print ("CLOUD X"+str(cloudoffsetx#)+"CLOUD Y"+str(cloudoffsety#))
print ("")
Print ("A="+str(buttona.held)+" B="+str(buttonb.held))
//print ("Distance: CM="+str(distancecent)+" Meters="+str(distancemeter) )
print ("JOY: X="+str(joyx#)+"Y="+str(joyy#) )
print ("SCROLLSPD:"+str(scrollspd)+" SCREENX#:"+str(screenx#))
print ("SCREENSCROLLX#="+str(screenscrollx#) )
endfunction
//Put together the level
function createlev()
loadice()
placeice()
x = 1
//im = 1
//Epic sized Background!
//100k000 meters
totsizetarget = 100000
f$="cave.png"
backdrop[1].id = CreateSprite ( LoadImage ( f$ ) )
setspritedepth(backdrop[1].id,depthsys.background)
//Collect imdata for fix bak to set lengtyh
fx# = GetspriteWidth( backdrop[1].id )
imsizex = round(fx#)
rep = 2 + round(totsizetarget /imsizex )
if rep >backdroparraysize then rep = backdroparraysize
//> backdroparraysize
for id = 2 to rep
backdrop[id].id = clonesprite (backdrop[1].id )
SetSpritePosition( backdrop[id].id, x, backgroundy )
backdrop[id].x = x
SetSpriteVisible(backdrop[id].id,1)
setspritedepth(backdrop[id].id,depthsys.background)
inc x,imsizex
next id
//global dim floorarray[3000] as integer
//global dim ceilarray[3000] as integer
//backdrop[1]>re>backdroparraysize
x = 1
//Load Tiles
f1$ = "mudgrasssection1.png"
for id = 1 to 2
if id = 1
floorarray[id].id = CreateSprite ( LoadImage ( f1$ ) )
else
floorarray[id].id = clonesprite( floorarray[1].id)
endif
SetSpritePosition( floorarray[id].id,x,floory)
SetSpriteVisible( floorarray[id].id,0)
SetSpriteDepth (floorarray[id].id , depthsys.bottum )
floorarray[id].x = x
floorarray[id].y = floory
floorarray[id].active = 1
inc x, 320
next id
//Create ceil f2
f2$ = "redrockselect1.png"
dec x,320
for id = 2 to 3000
//floorarray[id].id = CreateSprite ( LoadImage ( f2$ ) )
if id = 2
floorarray[2].id = CreateSprite ( LoadImage ( "lava.png" ) )
fxs = round(getspritewidth(floorarray[2].id))
else
floorarray[id].id = clonesprite( floorarray[2].id)
endif
SetSpritePosition( floorarray[id].id,x,floory)
SetSpriteVisible( floorarray[id].id,0)
SetSpriteDepth (floorarray[id].id , depthsys.bottum )
floorarray[id].x = x
floorarray[id].y = floory
floorarray[id].active = 1
inc x, fxs
next id
//Create Ceiling
x = 1
f3$ = "ceiling.png"
for id = 1 to 3000
if id = 1
ceilarray[id].id = CreateSprite ( LoadImage ( f2$ ) )
else
ceilarray[id].id = clonesprite(ceilarray[1].id )
endif
//Get size data
tmpxstep = getspritewidth( ceilarray[id].id )
SetSpritePosition( ceilarray[id].id,x,ceily)
SetSpriteVisible( ceilarray[id].id,0)
SetSpriteDepth (ceilarray[id].id , depthsys.top )
ceilarray[id].x = x
ceilarray[id].y = ceily
ceilarray[id].active = 1
inc x, tmpxstep
next id
//Place Nest nest has a care com somewhere
nest.x# = 60.0
nest.y# = 250.0
nest.active = 1
setspriteposition(nest.id,nest.x#,nest.y#)
setspritevisible(nest.id,1)
endfunction
function createillutionblocks()
global dim illutionblocks[4] as illtype
//In debug mode these blocks are visible
illutionblocks[1].id = createsprite(loadimage("ice/iceball5.png") )
illutionblocks[2].id = createsprite(loadimage("ice/iceball5.png") )
illutionblocks[3].id = createsprite(loadimage("ice/iceball5.png") )
//No Physics for this one its used to check colision to reduce player health
illutionblocks[4].id = createsprite(loadimage("ice/iceball5.png") )
if debug = 1
setspritedepth(illutionblocks[1].id,1)
setspritedepth(illutionblocks[2].id,1)
setspritedepth(illutionblocks[3].id,1)
setspritedepth(illutionblocks[4].id,1)
setspritevisible(illutionblocks[1].id,1)
setspritevisible(illutionblocks[2].id,1)
setspritevisible(illutionblocks[3].id,1)
setspritevisible(illutionblocks[4].id,1)
else
setspritedepth(illutionblocks[1].id,990)
setspritedepth(illutionblocks[2].id,990)
setspritedepth(illutionblocks[3].id,990)
setspritedepth(illutionblocks[4].id,991)
setspritevisible(illutionblocks[1].id,0)
setspritevisible(illutionblocks[2].id,0)
setspritevisible(illutionblocks[3].id,0)
setspritevisible(illutionblocks[4].id,0)
//Set off-screen
setspriteposition(illutionblocks[1].id,-100,-100)
setspriteposition(illutionblocks[2].id,-100,-100)
setspriteposition(illutionblocks[3].id,-100,-100)
setspriteposition(illutionblocks[4].id,-100,-100)
//SetSpritePhysicsDelete
illutionblocks[1].offx# = -100
illutionblocks[1].offy# = -100
illutionblocks[2].offx# = -100
illutionblocks[2].offy# = -100
illutionblocks[3].offx# = -100
illutionblocks[3].offy# = -100
illutionblocks[4].offx# = -100
illutionblocks[4].offy# = -100
endif
//Setup physics
SetSpritePhysicsOn ( illutionblocks[1].id,2)
SetSpritePhysicsOn ( illutionblocks[2].id,2)
SetSpritePhysicsOn ( illutionblocks[3].id,2)
//No physics for 4
endfunction
function controlplayer()
scrollscreen()
if incontrol = 0
if T# >takeofftimeto#
playery# = playery# - (takeoffspd#*frametime#)
takeofftimeto# = T# + 0.001
endif
//Switch to Play mode
if playery# < groundlevel# then incontrol = 1
else
//getinput()
endif
showdragon()
colision()
endfunction
//Colision Sytem!
function colision()
//illutionblocks[1].offx#/offy#-head
//illutionblocks[2].offx#/offy#-body
//illutionblocks[3].offx#/offy#-feet
//head
illutionblocks[1].offx# = playerx#+100
illutionblocks[1].offy# = playery#+55
setspriteposition(illutionblocks[1].id,illutionblocks[1].offx#,illutionblocks[1].offy#,)
//Body Block
illutionblocks[2].offx# = playerx#+60
illutionblocks[2].offy# = playery#+61
setspriteposition(illutionblocks[2].id,illutionblocks[2].offx#,illutionblocks[2].offy#,)
//Feet Block
illutionblocks[3].offx# = playerx#+50
illutionblocks[3].offy# = playery#+71
setspriteposition(illutionblocks[3].id,illutionblocks[3].offx#,illutionblocks[3].offy#,)
//Col Block
illutionblocks[4].offx# = playerx#+105
illutionblocks[4].offy# = playery#+55
setspriteposition(illutionblocks[4].id,illutionblocks[4].offx#,illutionblocks[4].offy#,)
//Perfect!
endfunction
function showdragon()
t#=timer()
//playerx/playery
//hide old frame
SetSpriteVisible(dragonframes[flywalk,im].id,0)
if t# > dragonframes[2,1].timeto#
if flywalk = 2 then if dragonframes[2,1].frame = 1 then playsound( sound[2] )
inc dragonframes[2,1].frame,1
if dragonframes[2,1].frame >8 then dragonframes[2,1].frame = 1
if flyalter.joyup = 1 then dragonframes[2,1].timeto# = t#+flyalter.uptime#
if flyalter.joydown = 1 then dragonframes[2,1].timeto# = t#+flyalter.downtime#
if flyalter.joycenter = 1 then dragonframes[2,1].timeto# = t#+flyalter.coasttime#
endif
im = dragonframes[2,1].frame
//Walk/Fly w= 205.3--groundlevel#
if playerx# <-10.0 + screenx# then playerx# = -10.0 + screenx#
if playerx# > (300 + screenx#) then playerx# = (300 + screenx#)
if playery# <15.0 then playery# = 15.0
if playery# >300.0 then playery# = 300.0
flywalk=2
if playery# > groundlevel# then flywalk = 1
setspritedepth (dragonframes[flywalk,image].id , 10)
SetSpriteVisible(dragonframes[flywalk,im].id,depthsys.player)
SetSpritePosition(dragonframes[flywalk,im].id,playerx#,playery#)
endfunction
function getinput()
joystickX# = 0.0 //GetVirtualJoystickX ( 1 )
joystickY# = GetVirtualJoystickY ( 1 )
joyx# = joystickX#
joyy# = joystickY#
flyalter.joyup = 0
flyalter.joydown = 0
flyalter.joycenter= 0
if ( joystickX# = 0.0 and joystickY# = 0.0 )
flyalter.joycenter = 1
else
//if joystickY# <0.0 then flyalter.joyup = 1 else flyalter.joydown = 1
// playerx# = playerx# + (joystickX# *sensivity)
playery# = playery# + (joystickY# *sensivity)
endif
if GetVirtualButtonPressed( 3 ) = 1 then if buttona.held = 0
buttona.held = 1
buttona.timepressed# = T#
endif
buttona.released = GetVirtualButtonReleased( 3 )
if buttona.released = 1 then buttona.held = 0
// T A R G E T V E C T O R tbi
//GetDirectionAngle//GetDirectionSpeed
//GetDirectionX
//GetDirectionY
//Attack
if GetVirtualButtonPressed( 2 ) = 1 then if buttonb.held = 0
//attacksound[attacksoundcounter] attsnds=
playsound (charge)
buttonb.held = 1
buttonb.timepressed# = T#
endif
buttonb.released = GetVirtualButtonReleased( 2 )
if buttonb.released = 1
buttonb.held = 0
stopsound(charge)
playsound(attacksound[attacksoundcounter])
inc attacksoundcounter,1
if attacksoundcounter > attsnds then attacksoundcounter = 1
launchattarget(buttonb.timepressed#)
endif
//Test Puposes button b resets level
if debug = 1 then if buttona.released = 1 then restart()
endfunction
remstart
//type target
//x# as float
//y# as float
//x as integer
//y as integer
//id as integer
//soundid as integer
//show as integer
//active as integer
//chargeneeded# as float
//endtype
//type m
//x# as float
//y# as float
//x as integer
//y as integer
//frame as integer
//T as integer
//t# as float
//soundid as integer
//show as integer
//active as integer
//charge# as float
//id as integer
//ang# as float
//dirx# as float#
//diry# as float#
//endtype
//Fire Power
//global fp = 100
//global dim targetcount[fp] as target
//global dim missile[fp] as m
remend
function loadweapons()
//Load Weapons.
//missile[1].id = CreateSprite ( LoadImage ( "ice/singleice.png" ) )
missile[1].id = CreateSprite ( LoadImage ( "ice/iceball5.png" ) )
setspritevisible(missile[1].id,0)
setspritedepth(missile[1].id,depthsys.missile)
setspritecolor(missile[1].id,10,200,255,250)
missile[1].soundid = 1000
missile[1].soundid = loadsound( "sounds/iceshatter.wav")
for set = 2 to fp
//targetcount[fp] as target
missile[set].id = clonesprite(missile[1].id)
setspritevisible(missile[set].id,0)
setspritedepth(missile[set].id,depthsys.missile)
//Load Sounds. used for freeze sound when comes into contact with other object
missile[set].soundid = 1000 + set -1
missile[set].soundid = loadsound( "sounds/iceshatter.wav")
next set
endfunction
//Fire Power
//global fp = 100
//global dim targetcount[fp] as target
//global dim missile[fp] as m
//Reset Missiles
//for a = 1 to fp
//targetcount[a].show = 0
//targetcount[a].active = 0
//targetcount[a].x = -100
//targetcount[a].y = -100
//targetcount[a].x# = -100.0
//targetcount[a].y# = -100.0
//targetcount[a].chargeneeded# =1.0
//next a
//F controliceblast()
function launchattarget(btib# as float)
targetx# = playerx#+2000
targety# = playery#
//Find free Ice-Blast
for free = 1 to fp
foundfree = 1
if missile[free].active = 0
foundfree = free
exit
endif
next free
missile[foundfree].active = 1
missile[foundfree].x# = playerx# + 108
missile[foundfree].y# = playery# + 55
icepower = (T#-btib#) *1000
missile[foundfree].charge# = 10.0 + icepower
setspriteposition(missile[foundfree].id,missile[foundfree].x#,missile[foundfree].y#)
setspritevisible(missile[foundfree].id,1)
endfunction
function controliceblast()
for ib = 1 to fp
if missile[ib].active = 1
//cbdist# = 75.250 * frametime#
cbdist# = (scrollspd#+missilespeed#) * frametime#
missile[ib].x# = missile[ib].x# + cbdist#
missile[ib].ang# = missile[ib].ang# + (133.250 *frametime#)
setspriteposition(missile[ib].id,missile[ib].x#,missile[ib].y#)
setspritevisible(missile[ib].id,1)
SetSpriteAngle( missile[ib].id, missile[ib].ang# )
//FX
iceparticles(ib,missile[ib].x#,missile[ib].y#)
//Remove by distance
if missile[ib].x# > (screenx#+410)
missile[ib].active = 0
setspritevisible(missile[ib].id,0)
endif
else
//FX
iceparticles(ib,-100,-100)
endif
next ib
endfunction
function collecttargetdata()
//targetcount[foundfree].active = 1
//targetcount[foundfree].show = 1
endfunction
//Target Control Sytem
function locatetargets()
endfunction
function showtarget()
endfunction
function showjoystick()
//GetVirtualButtonExists
AddVirtualJoystick ( 1, 48, 340, 100 )
if ( GetVirtualJoystickExists ( 1 ) = 1 )
SetVirtualJoystickVisible ( 1, 1 )
endif
AddVirtualButton( 2, 340, 365, 25 )
if ( GetVirtualbuttonExists ( 2 ) = 1 )
SetVirtualbuttonVisible ( 2, 1 )
endif
AddVirtualButton( 3, 370, 340, 25 )
if ( GetVirtualbuttonExists ( 3 ) = 1 )
SetVirtualbuttonVisible ( 3, 1 )
endif
//IceBlast
SetVirtualButtonColor(2,15,1,255)
//Fly
SetVirtualButtonColor(3,25,250,10)
endfunction
remstart
SetSpriteOffset( iSpriteIndex, x, y ) --add to images to enable less calculation re colision
-------------------Commands To Add-------------------
//+Clouds
//Final Stages: To Add
switch to screen ofset mode to enable physics most prb
Gravity
bats
Shadow of Dragon
spiders
HI-Score
HTTP Server Score
3D
•DeleteVideo
•GetVideoDuration
•GetVideoHeight
•GetVideoPlaying
•GetVideoPosition
•GetVideoWidth
•LoadVideo
•PauseVideo
•PlayVideo
•SetVideoDimensions
•SetVideoVolume
•StopVideo
Home > Commands > Extras
Extras
In App Purchase
•GetInAppPurchaseAvailable
•GetInAppPurchaseState
•InAppPurchaseActivate
•InAppPurchaseAddProductID
•InAppPurchaseRestore
•InAppPurchaseSetTitle
•InAppPurchaseSetup
GameCenter
•GameCenterAchievementsReset
•GameCenterAchievementsShow
•GameCenterLogin
•GameCenterSetup
•GameCenterShowLeaderBoard
•GameCenterSubmitAchievement
•GameCenterSubmitScore
•GetGameCenterExists
•GetGameCenterLoggedIn
Ratings
•RateApp
Notifications
•GetNotification
•GetNotificationData
•GetNotificationType
•NotificationCreate
•NotificationReset
•SetNotificationImage
•SetNotificationText
Twitter
•TwitterMessage
•TwitterSetup
PushNotifications
•GetPushNotificationToken
•PushNotificationSetup
Facebook
•FacebookDestroyLikeButton
•FacebookDownloadFriendsPhoto
•FacebookGetFriends
•FacebookGetFriendsCount
•FacebookGetFriendsID
•FacebookGetFriendsName
•FacebookGetFriendsState
•FacebookGetUserID
•FacebookGetUserName
•FacebookInviteFriend
•FacebookLogin
•FacebookLogout
•FacebookPostOnFriendsWall
•FacebookPostOnMyWall
•FacebookSetup
•FacebookShowLikeButton
•GetFacebookDownloadFile
•GetFacebookDownloadState
•GetFacebookLoggedIn
Cameras
•GetCameraAngleX
•GetCameraAngleY
•GetCameraAngleZ
•GetCameraQuatW
•GetCameraQuatX
•GetCameraQuatY
•GetCameraQuatZ
•GetCameraX
•GetCameraY
•GetCameraZ
•MoveCameraLocalX
•MoveCameraLocalY
•MoveCameraLocalZ
•RotateCameraGlobalX
•RotateCameraGlobalY
•RotateCameraGlobalZ
•RotateCameraLocalX
•RotateCameraLocalY
•RotateCameraLocalZ
•SetCameraFOV
•SetCameraLookAt
•SetCameraPosition
•SetCameraRange
•SetCameraRotation
•SetCameraRotationQuat
PointLights
•ClearLightPoints
•CreateLightPoint
•DeleteLightPoint
•GetLightPointExists
•SetLightPointColor
•SetLightPointPosition
•SetLightPointRadius
DirectionalLights
•ClearLightDirectionals
•CreateLightDirectional
•DeleteLightDirectional
•GetLightDirectionalExists
•SetLightDirectionalColor
•SetLightDirectionalDirection
Shaders
•LoadShader
•SetShaderConstantByName
General
•SetGlobal3DDepth
Objects
•CloneObject
•CreateObjectBox
•CreateObjectCone
•CreateObjectCylinder
•CreateObjectPlane
•CreateObjectSphere
•DeleteObject
•Get3DVectorXFromScreen
•Get3DVectorYFromScreen
•Get3DVectorZFromScreen
•GetObjectAngleX
•GetObjectAngleY
•GetObjectAngleZ
•GetObjectCullMode
•GetObjectDepthReadMode
•GetObjectDepthWrite
•GetObjectExists
•GetObjectInScreen
•GetObjectQuatW
•GetObjectQuatX
•GetObjectQuatY
•GetObjectQuatZ
•GetObjectRayCastBounceX
•GetObjectRayCastBounceY
•GetObjectRayCastBounceZ
•GetObjectRayCastDistance
•GetObjectRayCastHitID
•GetObjectRayCastNormalX
•GetObjectRayCastNormalY
•GetObjectRayCastNormalZ
•GetObjectRayCastNumHits
•GetObjectRayCastSlideX
•GetObjectRayCastSlideY
•GetObjectRayCastSlideZ
•GetObjectRayCastX
•GetObjectRayCastY
•GetObjectRayCastZ
•GetObjectTransparency
•GetObjectVisible
•GetObjectX
•GetObjectY
•GetObjectZ
•GetScreenXFrom3D
•GetScreenYFrom3D
•InstanceObject
•LoadObject
•MoveObjectLocalX
•MoveObjectLocalY
•MoveObjectLocalZ
•ObjectRayCast
•ObjectSphereCast
•ObjectSphereSlide
•RotateObjectGlobalX
•RotateObjectGlobalY
•RotateObjectGlobalZ
•RotateObjectLocalX
•RotateObjectLocalY
•RotateObjectLocalZ
•SetObjectCollisionMode
•SetObjectColor
•SetObjectCullMode
•SetObjectDepthReadMode
•SetObjectDepthWrite
•SetObjectImage
•SetObjectLightMode
•SetObjectLookAt
•SetObjectPosition
•SetObjectRotation
•SetObjectRotationQuat
•SetObjectScale
•SetObjectShader
•SetObjectTransparency
•SetObjectVisible
remend
function die()
hidescreen()
fadeoutscreen()
showhiscore()
//Show End Button!
end
endfunction
function hidescreen()
for id = 1 to backdroparraysize
SetSpriteVisible(backdrop[id].id,0)
next id
endfunction
function loaddragon()
for image = 0 to 8
dragonframes[1,image].id = CreateSprite ( LoadImage ( "dragon/w"+str(image)+".png" ) )
dragonframes[2,image].id = CreateSprite ( LoadImage ( "dragon/f"+str(image)+".png" ) )
dragonframes[3,image].id = CreateSprite ( LoadImage ( "dragon/l"+str(image)+".png" ) )
setspritedepth (dragonframes[1,image].id , depthsys.player)
setspritedepth (dragonframes[2,image].id , depthsys.player)
setspritedepth (dragonframes[3,image].id , depthsys.player)
SetSpriteVisible(dragonframes[1,image].id , 0)
SetSpriteVisible(dragonframes[2,image].id , 0)
SetSpriteVisible(dragonframes[3,image].id , 0)
next image
endfunction
function restart()
placeice()
playerx# = 220.0
playery# = 120.0
scrollspd = 1
distancecent = 0
distancemeter= 0
screenx# = 0.000
//set all array[id].id,x#,y# to starting positions
//rebuild walls
//Done
endfunction
//P A R T I C L E S B E L L O W GetParticleMaxReached ResetParticleCount.
function loadparticle()
global partpic as integer
global particlelife# = 1.0
global dim particle[100] as particletype
partpic = CreateSprite ( LoadImage ( "particles/particle.png" ) )
setspritecolor(partpic,100,100,255,250)
setspritevisible(partpic,0)
for mp = 1 to 100 //fp
particle[mp].color = 0
particle[mp].id = CreateParticles ( -110, -110 )
SetParticlesImage ( particle[mp].id , particle[1].id )
SetParticlesMax ( particle[mp].id , -1 )
SetParticlesAngle ( particle[mp].id , 45 )
SetParticlesFrequency ( particle[mp].id , 55 )
AddParticlesForce( particle[mp].id , 0.001, (particlelife# / 2), 3.0, 0.1 )
AddParticlesForce( particle[mp].id , (particlelife#/2), particlelife#, 0, 1.4 )
SetParticlesLife ( particle[mp].id , particlelife# )
SetParticlesSize ( particle[mp].id , 5 )
SetParticlesStartZone ( particle[mp].id , -5.0, -5.0, 5.0, 5.0 )
SetParticlesDirection ( particle[mp].id , -1, 0 )
if particle[mp].color = 0
AddParticlesColorKeyFrame ( particle[mp].id , 0, 190, 190, 255, 255 )
AddParticlesColorKeyFrame ( particle[mp].id , particlelife#, 5, 5, 50, 0 )
endif
SetParticlesVelocityRange( particle[mp].id , 0.1, 30.0 )
SetParticlesVisible(particle[mp].id ,1)
next mp
endfunction
function initclouds()
cloudoffsetx# = cloudsizex#
cloudoffsety# = cloudsizey#
setspriteuvoffset(clouds[1],0,0)
setspritevisible(clouds[1],1)
setspritevisible(clouds[2],1)
setspritevisible(clouds[3],1)
setspritevisible(clouds[4],1)
setspriteuvoffset(clouds[1],0,0)
setspriteuvoffset(clouds[2],0,0)
setspriteuvoffset(clouds[3],0,0)
setspriteuvoffset(clouds[4],0,0)
cax = getspritex(clouds[1] )
cbx = getspritex(clouds[2] )
ccx = getspritex(clouds[3] )
cdx = getspritex(clouds[4] )
FixSpriteToScreen(clouds[1],1)
FixSpriteToScreen(clouds[2],1)
FixSpriteToScreen(clouds[3],1)
FixSpriteToScreen(clouds[4],1)
endfunction
function controlclouds()
cloudoffsetx# = cloudoffsetx# + (0.50 *frametime#)
cloudoffsety# = cloudoffsety# + (0.35 *frametime#)
cloudoffsetxb# = cloudoffsetx# + 0.20
cloudoffsetyb# = cloudoffsety# + 0.30
setspriteuvoffset(clouds[1] , cloudoffsetx# ,cloudoffsety# )
setspriteuvoffset(clouds[2] , cloudoffsetx# ,cloudoffsety# )
setspriteuvoffset(clouds[3] , cloudoffsetx# ,cloudoffsety# )
setspriteuvoffset(clouds[4] , cloudoffsetx# ,cloudoffsety# )
endfunction
function updateT()
timelast# = T#
T# = timer()
frametime#=T# -timelast#
endfunction
function iceparticles(pid as integer,psx# as float,pcy# as float)
SetParticlesPosition( particle[pid].id,psx#+5, pcy#+8 )
endfunction
function controlparticle()
updateparticles(1,0.01)
endfunction
function flicker(l as integer)
if debug = 1 then print("light="+str(l)+" Black ="+str(100-l) +" Red="+str(90+l ) )
setspritecoloralpha(screengradblack,100-l )
setspritecoloralpha(screengrad,90+l )
endfunction
function fadeoutscreen()
endfunction
function showhiscore()
endfunction
function entername()
//integer GetTextInputCompleted() SetTextInputMaxChars( max ) StartTextInput( initial )
endfunction
//ON SCREEN ? SPRITE CHECKER
function spriteonscreen(i as integer)
result = 0
ix# as float
iy# as float
if getspriteexists(i)
ix# = getspritex(i)
iy# = getspritey(i)
if ix# > 1.0 and ix# < 800.0 then if iy# > 0 and iy# < 800 then result = 1
endif
endfunction result
function onscreenx(V as integer)
retval = 0
if v >-500 and V<500 then retval = 1
endfunction retval
function onscreeny(V as integer)
retval = 0
if v >0 and V<401 then retval = 1
endfunction retval
function spritecomingx(V as integer)
retval = 0
if v >-500 and V<500 then retval = 1
endfunction retval
function spritepastx(V as integer)
retval = 0
if v < GetViewOffsetX() then retval = 1
endfunction retval
///////////////////////////////////////////////////////////////////
//Speed Up Function. /////////// Main ///
///////////////////////////////////////////////////////////////////
function updatevisible()
for updatevissystem = 1 to scrollpersync
if getspriteexists(floorarray[scrollviscounter].id)
if floorarray[scrollviscounter].active = 1
if spritecomingx(floorarray[scrollviscounter].id) = 1
if getspritevisible (floorarray[scrollviscounter].id) = 0
setspritevisible(floorarray[scrollviscounter].id,1)
endif
else
if spritepastx(floorarray[scrollviscounter].id) = 1
floorarray[scrollviscounter].active = 0
setspritevisible(floorarray[scrollviscounter].id,0)
endif
endif
endif
endif
if getspriteexists(ceilarray[scrollviscounter].id)
if ceilarray[scrollviscounter].active = 1
if spritecomingx(ceilarray[scrollviscounter].id) = 1
if getspritevisible (ceilarray[scrollviscounter].id) = 0
setspritevisible(ceilarray[scrollviscounter].id,1)
endif
else
if spritepastx(ceilarray[scrollviscounter].id) = 1
ceilarray[scrollviscounter].active = 0
setspritevisible(ceilarray[scrollviscounter].id,0)
endif
endif
endif
endif
if getspriteexists(backdrop[scrollviscounter].id)
if backdrop[scrollviscounter].active = 1
if spritecomingx(backdrop[scrollviscounter].id) = 1
if getspritevisible (backdrop[scrollviscounter].id) = 0
setspritevisible(backdrop[scrollviscounter].id,1)
endif
else
if spritepastx(backdrop[scrollviscounter].id) = 1
backdrop[scrollviscounter].active = 0
setspritevisible(backdrop[scrollviscounter].id,0)
endif
endif
endif
endif
scrollviscounter = scrollviscounter +1
if scrollviscounter > vismax
scrollviscounter = 1
endif
next updatevissystem
endfunction
function scrollscreen()
updatevisible()
//StepPhysics
if useextraspeed =1
//extraspeedxinc# = 3.0
//inc extraspeedx#,extraspeedxinc#
//SetViewOffset ( extraspeedx#, 0 )
endif
if T# > timebeforespeed#
timebeforespeed# = T#+0.01
// scrollspd# = scrollspd# + (30.000* frametime#)
// scrollspd = scrollspd + (30.000* frametime#)
//Play Speedup sound
screenx# = screenx# + (scrollspd# )//* frametime#)
getinput()
SetViewOffset ( screenx#, 0 )
endif
//fix
if scrollspd# < topspd#
scroolspd# = scrollspd# + (gatherspeed#)//* frametime#)
else
scrollspd# = topspd#
endif
distancecent = round(screenx# *2) //distancecent+ (scrolldivspd# * frametime#)
distancemeter = round (distancecent / 100)
//Icecle-Walls
for g = 1 to levellength
for gs = 1 to cavesize
if gaps[g,gs].active = 1
//Remove Physics from objects hitting wall behind player!
if gaps[g,gs].x < 5 then SetSpritePhysicsDelete(gaps[g,gs].id)
gaps[g,gs].x = getspritex(gaps[g,gs].id)
gaps[g,gs].y = getspritey(gaps[g,gs].id)
//Cheap view fx top wall is top depth=1 and below dragon is 3
tmph = round(playery#+40)
if gaps[g,gs].y > tmph then setspritedepth(gaps[g,gs].id,depthsys.player+1) else setspritedepth(gaps[g,gs].id,depthsys.player-1)
//colision with wall ice-blast
for ib = 1 to fp
if missile[ib].active = 1
if abs(( gaps[g,gs].x+12) - (missile[ib].x#+11) ) <25.0 then if abs((gaps[g,gs].y+20) - (missile[ib].y# +11)) < 25.0
//SetSpritePhysicsDelete(gaps[g,gs].id)
SetSpritePhysicson(gaps[g,gs].id,hasgravity)
missile[ib].active = 0
setspritevisible(missile[ib].id,0)
//if charge was enough to destrow block then
//setspritevisible(gaps[g,gs].id,1)
//gaps[g,gs].active = 0
//endif
playsound(missile[ib].soundid)
SetSpritePhysicsImpulse( gaps[g,gs].id, missile[ib].x#+19, missile[ib].y# +11, 100 + missile[ib].charge#, 0 )
//Make block beneith look 3d - turn loose ice into Physics Fall
bbelow = gs+1
if bbelow < cavesize
if gaps[g,bbelow].active = 1
//gaps[g,bbelow].id = clonesprite(icebottumblock)
SetSpritePhysicson(gaps[g,bbelow].id,hasgravity)
endif
endif
endif
endif
next ib
//remove from active if left screen!
endif
next gs
next g
endfunction
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
function loadice()
//global icepart as integer
icepart = CreateSprite ( LoadImage ("ice/iceclepart.png") )
setspritevisible(icepart,0)
setspritecolor(icepart,0,150,150,180)
setspritevisible(icepart,0)
setspritedepth(icepart,depthsys.back)
//Used for block below a gap to look like its 3d
global icebottumblock as integer
icebottumblock = CreateSprite ( LoadImage ( "ice/icebottumblock.png" ) )
setspritecolor(icebottumblock,0,150,150,200)
setspritevisible(icebottumblock,0)
setspritedepth(icebottumblock,depthsys.back)
endfunction
function initphysics()
//Object
if hasgravity = 0
hasgravity = 2
endif
SetPhysicsWallBottom(1)
SetPhysicsWallLeft(0)
SetPhysicsWallRight(0)
SetPhysicsWallTop(0)
endfunction
function placeice()
//Create block array
for g = 1 to levellength
for gs = 1 to cavesize
gaps[g,gs].active = 1
next gs
//make a gap size gs/2 /3 /gs depending on how far
makegap = random(1,cavesize)
gaps[g,makegap].active = 0
next g
for g = 1 to levellength
for gs = 1 to cavesize
if gaps[g,gs].active = 1
tmpwx = 2000+ (g * wallgap)
tmpwy = (gs *40)-30 //get im height!
gaps[g,gs].id = clonesprite(icepart)
setspriteposition (gaps[g,gs].id,tmpwx,tmpwy )
gaps[g,gs].x# = tmpwx
gaps[g,gs].x = tmpwx
gaps[g,gs].y# = tmpwy
gaps[g,gs].y = tmpwy
setspritedepth (gaps[g,gs].id,depthsys.ice )
setspritevisible (gaps[g,gs].id,depthsys.ice )
else
//Make block beneith gap look 3d
bbelow = gs+1
if bbelow < cavesize
if gaps[g,bbelow].active = 1
if GetSpriteExists (gaps[g,bbelow].id) = 1
blx# = getspritex(gaps[g,bbelow].id)
bly# = getspritey(gaps[g,bbelow].id)
setspritevisible (gaps[g,bbelow].id,0)
setspritedepth (gaps[g,bbelow].id,depthsys.back)
deletesprite (gaps[g,bbelow].id)
endif
gaps[g,bbelow].id = clonesprite(icebottumblock)
setspritedepth (gaps[g,bbelow].id,depthsys.ice)
setspritevisible (gaps[g,bbelow].id,1)
inc gs,1
endif
endif
endif
next gs
if wallgap > 30 then dec wallgap,1
next g
remstart
//-P H Y S I C S-//
// SetSpriteSize ( index, size, size )
// SetSpriteShape ( index, 2 )
// SetSpritePhysicsAngularImpulse ( index, 10000 + Random ( 0, 350 ) )
// SetSpritePhysicsVelocity ( index, 100 + Random ( 0, 100 ), 100 + Random ( 0, 100 ) )
// SetSpriteColor ( index, Random ( 0, 255 ), Random ( 0, 255 ), Random ( 0, 255 ), 255 )
// SetSpritePhysicsRestitution ( index, 0.5 )
// set default gravity
//SetPhysicsGravity ( 0, 0.5 )
// set 1 and 2 to be dynamic,
//3 to be static and 4 and 5 to be dynamic
//SetSpritePhysicsOn ( 1, 2 ) ice
//SetSpritePhysicsOn ( 2, 2 ) ice
//SetSpritePhysicsOn ( 3, 1 ) Player type//Missile type
//SetSpritePhysicsOn ( 4, 2 ) ice
//SetSpritePhysicsOn ( 5, 2 ) ice
// set the position and turn physics on
//SetSpritePosition ( 1, 150, 50 )
//SetSpritePhysicsOn ( 1, 2 )
// remove the bottom physics wall
//SetPhysicsWallBottom ( 0 )
// apply an impulse
//SetSpritePhysicsImpulse ( 1, 150, 50, 10000, 0 )
remend
//fix
remstart
//Setup Physics
for g = 1 to levellength
for gs = 1 to cavesize
//gaps[g,bbelow].id
if gaps[g,gs].active = 1
//Wait till on screen to activate physics! -stepphysics()
SetSpritePhysicsOn ( gaps[g,gs].id,hasgravity )
SetSpritePhysicsMass (gaps[g,gs].id,3)
SetSpritePhysicsRestitution(gaps[g,gs].id,0.3)
endif
next gs
next g
remend
//Setup Joints--Top is connected to roof. Bottum is on floor
//This will allow pulses to push blocks out unjoining and
//loose ice will fall
endfunction
//Power up or by distance(scrollspd) not sure > Decided > powerup <
function controlsensitivity()
//Start off at between 1 and 3
//if scrollspd = 3 then sensivity = 4
//time based increase in response to match increased speed of game
endfunction
function menu()
//bd HIDE LOADING SCREEN
notstarted = 1
//menuscreen = createsprite(loadimage("menu/dragon-Main.png"))
setspriteposition(menuscreen,0,0)
setspritedepth(menuscreen,1)
setspritevisible(menuscreen,1)
while notstarted = 1
//print("PRESS TO START")
if GetPointerPressed() = 1 then notstarted = 0
sync()
endwhile
setspriteposition(menuscreen,-800,-800)
setspritedepth(menuscreen,999)
setspritevisible(menuscreen,0)
endfunction
Mod edit: Added code tags to your code
Mince