it's in some shit basic in this thing called AGK
it allows you to do cross platform stuff
Code:SetDisplayAspect( 4.0/3.0 ) dim spriteArray[100] ` load media loadImage(6,"cone.png") loadImage(1,"horsehead.png") loadImage(2,"me.png") loadImage(3,"me3.png") loadImage(4,"me2.png") loadImage(5,"me1.png") loadSound(1,"bubbles.wav") loadSound(2,"whinny.wav") loadSound(3,"whinny2.wav") loadSound(4,"gallop.wav") loadSound(5,"trot.wav") loadMusic(1,"horse_with_no_name.mp3") playMusic(1,1) ` create arrogant cunting paki frame = 2 paki = createSprite(0) AddSpriteAnimationFrame(paki, 2) AddSpriteAnimationFrame(paki, 3) AddSpriteAnimationFrame(paki, 4) AddSpriteAnimationFrame(paki, 5) setSpriteSize(paki,6,-1) setSpriteOffset(paki,3,getSpriteHeight(paki)/2) setSpritePositionByOffset(paki,50,50) setSpriteDepth(paki,50) fixSpriteToScreen(paki,1) ` create sprite array with parallax scrolling for s=1 to 100 ` create a sprite using either a cone or a horsehead pic=random(0,1) if pic=0 spr = createSprite(1) else spr = createSprite(6) endif ` get a random depth, color and alpha d = random(1,100) r = random(0,255) g = random(0,255) b = random(0,255) if pic=0 a = random(128,255) else a=random(192,255) endif ` set the sprite size and depth setSpriteDepth(spr,d) setSpriteSize(spr,random(1.0,20.0)-(d/random(20.0,100.0)),-1) setSpriteColor(spr,r,g,b,a) ` set it at a random position in our world setSpritePosition(spr,random(0,100),random(0,100)) ` add to the array spriteArray[s] = spr next ` oh my god do ` view offset vx# = getViewOffsetX() vy# = getViewOffsetY() ` 100 sprites for s=1 to 100 spr = spriteArray[s] d# = getSpriteDepth(spr) `set sprite offsets based on the view offset Xoff# = -(d#-100.0)*0.01*vx# Yoff# = -(d#-100.0)*0.01*vy# setSpriteOffset(spr,Xoff#,Yoff#) `check it wx# = getSpriteX(spr) wy# = getSpriteY(spr) sx# = worldToScreenX(wx#) sy# = worldToScreenY(wy#) `if not a new position if sx#<0 then setSpritePosition(spr,wx#+100,wy#) if sx#>100 then setSpritePosition(spr,wx#-100,wy#) if sy#<0 then setSpritePosition(spr,wx#,wy#+100) if sy#>100 then setSpritePosition(spr,wx#,wy#-100) next ` adjust the view and orientation of the paki x# = getDirectionX() y# = -getDirectionY()*0.2 a# = getSpriteAngle(paki) setSpriteAngle(paki,a#+x#) setViewOffset(getViewOffsetX()+y#*cos(90-a#),getViewOffsetY()-y#*sin(90-a#)*getDisplayAspect()) ` animate the paki if abs(y#)>0.1 if GetMusicExists(1) resumemusic() else playmusic(1) endif frame = frame+1 print("c-c-c-c-c-c") if frame>4 then frame=2 print("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") print("gg") else pausemusic() frame = 1 print("oh my god!") text=random(1,3) if text=1 then print("i'm going to puke...") print("") if text=2 then print("ffffffffffffffffuuuu") print("") if text=3 then print("i can't even hear what she's saying!") print("") endif setSpriteFrame(paki,frame) if GetPointerPressed()=1 playsound(3) endif sync() loop
Results 1 to 30 of 32
Threaded View
-
07-14-2013
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)