Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; PROJECT : Castle Crush
- ; AUTHOR : NA
- ; CREATED : 12/27/2011
- ; EDITED : 4/16/2015
- ; ---------------------------------------------------------------------
- SETFPS 60
- openscreen 1024, 768, 32, 1
- ;castle=loadnewfximage("castlecrush.png")
- ;castle=newfximage(12000, 500*16)
- ;rendertoimage castle
- cls rgb(0, 0, 0)
- print "Press any key to start"
- sync
- waitkey
- waitnokey
- ;imagemaskcolour castle, rgb(255, 0, 255) ;purpleish?
- ;imagemaskcolour castle, rgb(255, 255, 255) ;white
- mode=loadnewfximage("mode.png")
- snd = loadnewsound("sounds/Barrel blast barrel.mp3")
- loading = loadnewsound("music/nintendo-21-steel-drum-rhumba.mp3");
- loaded = loadnewsound("music/nintendo-08-bayou-boogie.mp3");
- blastbarrel = loadnewsound("sounds/Barrel blast barrel.mp3");
- Crateopens = loadnewsound("sounds/Animal crate open DKC2.mp3");
- ballooncollect=loadnewsound("sounds/Life gained DKC2.mp3")
- bananacollect=loadnewsound("sounds/Banana DKC2.mp3")//the sound for a single banananay!!
- quay=loadnewfximage("maps/Krem_Quay_Overworld_-_Donkey_Kong_Country_2.png")
- scaleimage quay, 2, 2, 0
- overworldmusic=loadnewsound("music/nintendo-02-welcome-to-crocodile-isle.mp3")
- playsound snd;
- //playsound loading
- WIDTH=12000
- HEIGHT=500*16
- save=loadnewfximage("save.png")
- playmode=loadnewfximage("Playmode.png")
- grid=false
- backdrop=loadnewfximage("bgs/mine.png")
- imagemaskcolour backdrop, rgb(255, 255, 255)
- sky=loadnewfximage("Sprites/Bramble_sky.bmp")
- levelname$="castle crush"
- wallx=0
- wally=0
- bananatimer=timer()+30
- spinframe=1
- spinframetimer=timer()+30
- maxhelicopterfall=4
- barreli=loadnewfximage("Sprites/barrel.bmp")
- imagemaskcolour barreli, rgb(255, 255, 255)
- dixieholdingbarrel=false
- dixiemounted=false
- barrelwidth=30
- barrelheight=39
- pickingup=false
- puttingdown=false
- barrelfalltimer=timer()+30
- fallspeed=1
- menu=1 ;menu means current view of objects/tiles/sprites
- dixiemovespeed=6
- rambix=1000
- rambiy=320
- rambiframe=1
- beetimer=timer()+30
- //This deals with the squitter Crate, and squitter
- SquitterCrateX=0
- SquitterCrateY=0
- SquitterCrateFrame=1
- SquitterX=0
- SquitterY=0
- SquitterFrame=1
- CrateOpened=false; ///Don't animate the crate till it's open!
- ;inbarrel=false
- ;tileset$=currentdir$()+"rickety"
- ;if folderexist(tileset$);
- ; for temp=1 to
- ;if fileexist("C:\brambles_map2.txt")
- ;copyfile "C:\brambles_map2.txt", "levels\brambles_map2.txt"
- ;endif
- tiles=loadnewfximage("Sprites/Bayou.png")
- dim tiles(598)
- tile=1
- rendertoimage tiles
- for tempx=1 to 23
- for tempy=1 to 26
- x1=(tempx-1)*32
- y1=(tempy-1)*32
- x2=tempx*32
- y2=tempy*32
- ;x1=x1+tempx ;account for white space
- ;y1=y1+tempy ;account for white space
- ;x2=x2+tempx ;account for white space
- ;y2=y2+tempy ;account for white space
- tiles(tile)=newfximage(32, 32)
- getimage tiles(tile), x1, y1, x2, y2
- imagemaskcolour tiles(tile), rgb(255, 255, 255)
- tile=tile+1
- ;if tile>598 then tile=598
- ;sync
- next tempy
- next tempx
- rendertoscreen
- deleteimage tiles
- dim dixieright(18)
- dim dixieleft(18)
- for temp=1 to 18
- dixieright(temp)=loadnewfximage("sprites/dixieframe"+str$(temp)+".bmp")
- imagemaskcolour dixieright(temp), rgb(255,255, 255)
- dixieleft(temp)=newfximage(55, 45)
- copyimage dixieright(temp), dixieleft(temp)
- mirrorimage dixieleft(temp), 1, 0
- next temp
- dim dixiejumpright(4)
- dim dixiejumpleft(4)
- for temp=1 to 4
- dixiejumpright(temp)=loadnewfximage("Sprites/dixiejump"+str$(temp)+".bmp")
- imagemaskcolour dixiejumpright(temp), rgb(255, 255, 255)
- dixiejumpleft(temp)=newfximage(55, 74)
- copyimage dixiejumpright(temp), dixiejumpleft(temp)
- mirrorimage dixiejumpleft(temp), 1, 0
- imagemaskcolour dixiejumpleft(temp), rgb(255, 255, 255)
- next temp
- dim squitterwalkright(15)
- for temp=1 to 15
- squitterwalkright(temp)=loadnewfximage("sprites/SquitterRight"+str$(temp)+".png")
- imagemaskcolour squitterwalkright(temp), rgb(255, 255, 255)
- next temp
- dim dixieow(8)
- for temp=1 to 8
- dixieow(temp)=loadnewfximage("sprites/dixieow"+str$(temp)+".png")
- scaleimage dixieow(temp), 2, 2, 0
- imagemaskcolour dixieow(temp), rgb(255, 255, 255)
- next temp
- ;load and flip dixie's spinning animations for hovering helicoptering
- dim dixiespinright(10)
- dim dixiespinleft(10)
- for temp=1 to 10
- dixiespinright(temp)=loadnewfximage("Sprites/dixiespin"+str$(temp)+".bmp")
- dixiespinleft(temp)=newfximage(getimagewidth(dixiespinright(temp)), getimageheight(dixiespinright(temp)) )
- copyimage dixiespinright(temp), dixiespinleft(temp)
- mirrorimage dixiespinleft(temp), 1, 0
- imagemaskcolour dixiespinright(temp), rgb(255, 255, 255)
- imagemaskcolour dixiespinleft(temp), rgb(255, 255, 255)
- next temp
- dim dixiepickupbarrelright(14)
- dim dixiepickupbarrelleft(14)
- for temp=1 to 14
- dixiepickupbarrelright(temp)=loadnewfximage("Sprites/dixiepickupbarrel"+str$(temp)+".bmp")
- dixiepickupbarrelleft(temp)=newfximage(getimagewidth(dixiepickupbarrelright(temp)), getimageheight(dixiepickupbarrelright(temp)) )
- copyimage dixiepickupbarrelright(temp), dixiepickupbarrelleft(temp)
- mirrorimage dixiepickupbarrelleft(temp), 1, 0
- imagemaskcolour dixiepickupbarrelleft(temp), rgb(255, 255, 255)
- imagemaskcolour dixiepickupbarrelright(temp), rgb(255, 255, 255)
- next temp
- dixiemountedright=loadnewfximage("Sprites/DixieRidingRight.bmp")
- dixiemountedleft=newfximage(getimagewidth(dixiemountedright), getimageheight(dixiemountedright) )
- copyimage dixiemountedright, dixiemountedleft
- mirrorimage dixiemountedleft, 1, 0
- imagemaskcolour dixiemountedleft, rgb(255, 255, 255)
- imagemaskcolour dixiemountedright, rgb(255, 255, 255)
- dim barrel_(4)
- barrel_(1)=loadnewfximage("Sprites/Barrelup.bmp")
- barrel_(2)=loadnewfximage("Sprites/Barreldown.bmp")
- barrel_(3)=loadnewfximage("Sprites/Barrelleft.bmp")
- barrel_(4)=loadnewfximage("Sprites/Barrelright.bmp")
- for temp=1 to 4
- imagemaskcolour barrel_(temp), rgb(255, 255, 255)
- next temp
- dim dk_barrel_(7)
- for temp=1 to 7
- dk_barrel_(temp)=loadnewfximage("Sprites/dkbarrel"+str$(temp)+".bmp")
- imagemaskcolour dk_barrel_(temp), rgb(255, 255, 255)
- next temp
- //This is the create squitter comes out of.
- //For now it will replace the test barrel in the code
- dim squittercrate(3)
- squittercrate(1)=loadnewfximage("Sprites/SpiderCrate.png")
- imagemaskcolour squittercrate(1), rgb(255, 255, 255)
- for temp=2 to 3
- squittercrate(temp)=loadnewfximage("Sprites/CrateOpen"+str$(temp-1)+".png")
- imagemaskcolour squittercrate(temp), rgb(255, 255, 255);
- next temp
- ;load zingers graphics
- dim zingerfacesleft(3)
- dim zingerfacesright(3)
- for temp=1 to 3
- zingerfacesleft(temp)=loadnewfximage("Sprites/zingerframe"+str$(temp)+".bmp")
- zingerfacesright(temp)=newfximage(getimagewidth(zingerfacesleft(temp)), getimageheight(zingerfacesleft(temp)) )
- copyimage zingerfacesleft(temp), zingerfacesright(temp)
- mirrorimage zingerfacesright(temp), 1, 0
- imagemaskcolour zingerfacesleft(temp), rgb(255, 255, 255)
- imagemaskcolour zingerfacesright(temp), rgb(255, 255, 255)
- next temp
- dim beatlefacesleft(8)
- dim beatlefacesright(8)
- for temp=1 to 8
- beatlefacesleft(temp)=loadnewfximage("Sprites/Bugframe"+str$(temp)+".bmp")
- beatlefacesright(temp)=newfximage(getimagewidth(beatlefacesleft(temp)), getimageheight(beatlefacesleft(temp)) )
- copyimage beatlefacesleft(temp), beatlefacesright(temp)
- mirrorimage beatlefacesright(temp), 1, 0
- imagemaskcolour beatlefacesleft(temp), rgb(255, 255, 255)
- imagemaskcolour beatlefacesright(temp), rgb(255, 255, 255)
- next temp
- dim bananaframes(8)
- for temp=1 to 8
- bananaframes(temp)=loadnewfximage("Sprites/bananaframe"+str$(temp)+".png")
- imagemaskcolour bananaframes(temp), rgb(255, 255, 255)
- next temp
- dim rambi_run_right(15)
- dim rambi_run_left(15)
- for temp=1 to 15
- rambi_run_right(temp)=loadnewfximage("Sprites/Rambi_run"+str$(temp)+".bmp")
- rambi_run_left(temp)=newfximage(getimagewidth(rambi_run_right(temp)), getimageheight(rambi_run_right(temp) ) )
- copyimage rambi_run_right(temp), rambi_run_left(temp)
- mirrorimage rambi_run_left(temp), 1, 0
- imagemaskcolour rambi_run_right(temp), rgb(255, 255, 255)
- imagemaskcolour rambi_run_left(temp), rgb(255, 255, 255)
- next temp
- dim krook_walk_left(11)
- dim krook_walk_right(11)
- for temp=1 to 11
- krook_walk_left(temp)=loadnewfximage("sprites/krookwalkleft"+str$(temp)+".bmp")
- krook_walk_right(temp)=newfximage(getimagewidth(krook_walk_left(temp)), getimageheight(krook_walk_left(temp) ) )
- copyimage krook_walk_left(temp), krook_walk_right(temp)
- mirrorimage krook_walk_right(temp), 1, 0
- imagemaskcolour krook_walk_right(temp), rgb(255, 255, 255)
- imagemaskcolour krook_walk_left(temp), rgb(255, 255, 255)
- next temp
- dim rolling_barrel(7)
- for temp=1 to 7
- rolling_barrel(temp)=loadnewfximage("sprites/rolling_barrel"+str$(temp)+".bmp")
- imagemaskcolour rolling_barrel(temp), rgb(255, 255, 255)
- next temp
- dim balloon(5)
- for temp=1 to 5
- balloon(temp)=loadnewfximage("Sprites/RedBallon"+str$(temp)+".png")
- imagemaskcolour balloon(temp), rgb(255, 255, 255)
- next temp
- type camera
- x
- y
- endtype
- //We're going to make all of the above objects universal now
- type object
- x //For bananas
- y //For bananas
- frame
- collected
- x1
- y1
- x2
- y2
- frametimer
- directionleft
- facing
- landed ;is able to fall off or walk off edges
- falling ;is able to fall
- obj_type //This lets us identify what the object is
- //We're going to say 1 is bananas
- //We're going to say 2 is beatles
- //We're going to say 3 is krooks
- //We're going to say 4 is zinger
- endtype
- dim GameObjects(300) as object
- //We don't need this anymore
- //dim bananas(50) as object
- current_object=1
- //These are bananas
- for temp=1 to 50
- //randomize timer()
- GameObjects(current_object).x=rndrange(0, WIDTH/5)
- GameObjects(current_object).y=rndrange(0, HEIGHT/5)
- GameObjects(current_object).frame=rndrange(1, 8)
- GameObjects(current_object).collected=false
- GameObjects(current_object).obj_type = 1
- current_object=current_object+1 //Iterate the current object pointer that way we know what we have
- next temp
- dim cameras(3) as camera
- currentcamera=1
- //dim krooks(32) as object
- ///These are krooks
- for temp=1 to 32
- GameObjects(current_object).frame=1
- GameObjects(current_object).frametimer=timer()+30
- GameObjects(current_object).x1=rndrange(0, 500)
- GameObjects(current_object).y1=rndrange(0, 400)
- GameObjects(current_object).facing=rndrange(1, 2)
- GameObjects(current_object).directionleft=300
- GameObjects(current_object).obj_type = 2
- current_object=current_object+1
- next temp
- //dim zingers(32) as object These are zingers
- for temp=1 to 32
- GameObjects(current_object).frame=1
- GameObjects(current_object).frametimer=timer()+30
- GameObjects(current_object).x1=rndrange(0, 500)
- GameObjects(current_object).y1=rndrange(0, 400)
- GameObjects(current_object).facing=rndrange(1, 2)
- //if GameObjects(current_object).facing=0 then GameObjects(current_object).facing=1
- GameObjects(current_object).directionleft=30
- GameObjects(current_object).obj_type = 3
- current_object=current_object+1
- next temp
- //dim beatles(50) as object
- for temp=1 to 32
- GameObjects(current_object).frame=1
- GameObjects(current_object).frametimer=timer()+30
- GameObjects(current_object).facing=rndrange(1, 2)
- GameObjects(current_object).falling=true
- GameObjects(current_object).landed=false
- GameObjects(current_object).x1=rndrange(0, 500)
- GameObjects(current_object).y1=rndrange(0, 400)
- GameObjects(current_object).obj_type = 4
- current_object=current_object+1
- next temp
- //Note to self, add an attribute called collected_Sound later
- for temp=1 to 32
- gameobjects(current_object).frame=1
- gameobjects(current_object).frametimer=timer()+10
- gameobjects(current_object).falling=false
- gameobjects(current_object).landed=false
- gameobjects(current_object).x=rndrange(0, WIDTH/5)
- gameobjects(current_object).y=rndrange(0, HEIGHT/5)
- gameobjects(current_object).obj_type=5
- gameobjects(current_object).collected=false
- current_object=current_object+1
- next temp
- dim dkcoin(8)
- for temp=1 to 8
- dkcoin(temp)=loadnewfximage("Sprites/dkcoinframe"+str$(temp)+".bmp")
- imagemaskcolour dkcoin(temp), rgb(255, 255, 255)
- next temp
- dkcoinframe=1
- obj_hook=loadnewfximage("Sprites/Obj_hook.bmp")
- imagemaskcolour obj_hook, rgb(255, 255, 255)
- dixieaction=1
- jumpframe=1
- dixieblasted=false
- ;for editing stuff right here <
- current_blast_barrel=1
- ;>
- SCROLLX=0
- SCROLLY=0
- MAPWIDTH=roundup(WIDTH/16)
- MAPHEIGHT=roundup(HEIGHT/16)
- spritewidth=35
- spriteheight=25
- dixieframe=1
- frametimer=timer()+30
- maxfallspeed=12
- falltimer=timer()+30 ;.5 miliseconds for falling increase
- wallspeed=25
- charx=400
- chary=12128
- falling=false
- walltimer=timer()+wallspeed
- spunalready=false
- spinning=false
- MODE$="View"
- type solid_tile
- x1
- y1
- x2
- y2
- endtype
- type barrel
- x1
- y1
- x2
- y2
- falling
- landed
- fallspeed
- draw
- falltimer
- state
- frame
- frametimer
- endtype
- type blast_barrel
- x1
- y1
- x2
- y2
- facing_type
- blast_range
- endtype
- type hookobj
- x1
- y1
- x2
- y2
- endtype
- dim b_barrels(30) as blast_barrel
- for temp=1 to 30
- b_barrels(temp).facing_type=1
- next temp
- dim barrels(100) as barrel
- for temp=1 to 100
- barrels(temp).fallspeed=1
- barrels(temp).falling=true
- barrels(temp).landed=false
- barrels(temp).x1=rndrange(0, 640)
- barrels(temp).y1=rndrange(0, 640)
- barrels(temp).draw=true
- barrels(temp).falltimer=timer()+100
- barrels(temp).state=1
- barrels(temp).frame=1
- barrels(temp).frametimer=timer()+30
- next temp
- dim hooks(30) as hookobj
- current_hook=1
- dim map(MAPWIDTH, MAPHEIGHT)
- dim TILEMAP(MAPWIDTH/2, MAPHEIGHT/2) ;32 by 32 pixel tiles
- dim solids(MAPWIDTH, MAPHEIGHT) as solid_tile
- read=true
- if fileexist("levels\brambles_map3.txt") then read=true
- IF READ=TRUE
- readfile "levels\brambles_map3.txt", 1
- ink rgb(0, 0, 255)
- tile_to_read=1
- totaltiles=MAPWIDTH*MAPHEIGHT
- rendertoscreen
- Mapwidth=readint(1)
- mapheight=readint(1)
- charx=readint(1)
- chary=readint(1)
- scrollx=readint(1)
- scrolly=readint(1)
- dim map(MAPWIDTH, MAPHEIGHT)
- dim TILEMAP(MAPWIDTH/2, MAPHEIGHT/2) ;32 by 32 pixel tiles
- dim solids(MAPWIDTH, MAPHEIGHT) as solid_tile
- coinframetimer=timer()+30
- for tempx=1 to MAPWIDTH
- for tempy=1 to MAPHEIGHT
- map(tempx, tempy)=readint(1)
- solids(tempx, tempy).x1=readint(1)
- solids(tempx, tempy).y1=readint(1)
- solids(tempx, tempy).x2=readint(1)
- solids(tempx, tempy).y2=readint(1)
- x1=solids(tempx, tempy).x1
- y1=solids(tempx, tempy).y1
- x2=solids(tempx, tempy).x2
- y2=solids(tempx, tempy).y2
- ;rendertoimage castle
- ;box x1, y1, x2, y2,
- ;rendertoscreen
- ;tile_to_read=tile_to_read+1
- next tempy
- print "Loading SOLID TILE DATA PLEASE WAIT "
- print "Reading Across X: "+str$(tempx)
- print "Total Reads remaining: "+str$(MAPWIDTH-tempx)
- percent#=((tempx*100)/MAPWIDTH)
- print "Percent completed "+str$(percent#)
- ink rgb(percent#*2, percent#, 255)
- box 200, 50, 200+(percent#)*5, 60, 1
- ink rgb(0, 255, 0)
- box 200, 50, 200+100*5, 60, 0
- //drawimage dk_barrel_(dkcoinframe), 180+percent#*5, 20, 1
- sync
- cls rgb(0,0,0)
- dkcoinframe=dkcoinframe+1
- if dkcoinframe=>7
- dkcoinframe=1
- endif
- next tempx
- for tempx=1 to MAPWIDTH/2
- for tempy=1 to MAPHEIGHT/2
- TILEMAP(tempx, tempy)=readint(1)
- next tempy
- next tempx
- for temp=1 to 30
- b_barrels(temp).facing_type=readint(1)
- b_barrels(temp).x1=readint(1)
- b_barrels(temp).y1=readint(1)
- b_barrels(temp).x2=readint(1)
- b_barrels(temp).y2=readint(1)
- next temp
- closefile 1
- falling=true
- mode$="playmode"
- ENDIF
- myimage=newfximage(640, 480)
- ;imagemaskcolour myimage, rgb(255, 0, 255) ;purple ish?
- rendertoimage myimage
- cls rgb(255, 255, 255)
- imagemaskcolour myimage, rgb(255, 255, 255); white
- HEIGHT=500*16
- WIDTH=12000
- rendertoimage castle
- if grid=true
- for tempx=1 to WIDTH/16
- for tempy=1 to HEIGHT/16
- ink rgb(255,255, 255)
- box (tempx-1)*16, (tempy-1)*16, tempx*16, tempy*16, 0
- next tempy
- next tempx
- endif
- rendertoscreen
- cameras(currentcamera).x=charx
- cameras(currentcamera).y=chary
- //stopsound loading;
- //playsound loaded;
- playsound overworldmusic
- in_level=false
- dixieowframetimer=timer()+30
- dixieowframe=1
- dixieowx=300
- dixieowy=300
- do
- repeating:
- if in_level=false
- //we're going to deal with the overworld and only the overworld here
- drawimage quay, 0, 0, 0
- drawimage dixieow(dixieowframe), dixieowx, dixieowy, 1
- if timer()>dixieowframetimer
- dixieowframetimer=timer()+30
- dixieowframe=dixieowframe+1
- if dixieowframe>8 then dixieowframe=1
- endif
- ink rgb(255, 255, 255)
- text 100, 500, "Test Level. Space to begin"
- if spacekey()
- stopsound overworldmusic
- playsound loaded
- cls rgb(0,0,0)
- in_level=true
- goto start_game
- endif
- sync
- cls rgb(0,0,0)
- if in_level=false then goto repeating
- endif
- start_Game:
- //if cameras(currentcamera).x<charx then cameras(currentcamera).x=cameras(currentcamera).x+15
- //if cameras(currentcamera).x>charx then cameras(currentcamera).x=cameras(currentcamera).x-15
- //if cameras(currentcamera).y<chary then cameras(currentcamera).y=cameras(currentcamera).y+15
- //if cameras(currentcamera).y>chary then cameras(currentcamera).y=cameras(currentcamera).y-15
- scrollimage sky, -1, 0
- if enterkey()
- chary=1
- scrolly=0
- endif
- if dixieblasted=false
- if falling=true
- if timer()>falltimer
- fallspeed=fallspeed+1
- if spinning=true
- falltimer=timer()+10
- else
- falltimer=timer()+5
- endif
- if fallspeed>maxfallspeed then fallspeed=maxfallspeed
- endif
- endif
- endif
- if dixieholdingbarrel=true
- if spacekey()
- if downkey()
- puttingdown=true
- pickingup=false
- endif
- endif
- endif
- ;for temp=1 to 300
- ;pushbananaframe(temp)
- ;next temp
- ;if timer()>walltimer
- ;walltimer=timer()+wallspeed
- ;if falling=true
- ;if chary=>wally-spriteheight-1
- ; chary=wally-spriteheight-1
- ;landed=true
- ; falling=false
- ;onwall=true
- ; else
- ; onwall=false
- ;endif
- ;endif
- if jump=false
- if falling=false
- if onwall=true
- ;chary=chary-1
- endif
- endif
- endif
- ; wally=wally-1
- ;scrolly=scrolly-1
- if mode$="playmode"
- if onwall=true
- ;pan camera down slowly
- if scrolly<wally-400
- scrolly=scrolly+2
- scrollimage backdrop, 0, -2
- scrollimage sky, 0, 1
- else
- scrolly=wally-400
- endif
- if scrolly>11776 then scrolly=11776
- endif
- endif
- ;draw map
- ;render to the map image
- rendertoscreen
- rendertoimage castle
- x=mousex()
- y=mousey()
- if SCROLLX=>16
- amountx=roundup(SCROLLX/16)
- else
- amountx=1
- endif
- ;top side same thing as above
- if SCROLLY=>16
- amounty=roundup(SCROLLY/16)
- else
- amounty=1
- endif
- moveright=true
- moveleft=true
- screenx1=amountx
- screeny1=amounty
- screenx2=32+amountx
- screeny2=30+amounty
- screenx1=screenx1*16
- screeny1=screeny1*16
- screenx2=screenx2*16
- screeny2=screeny2*16
- for tempx=amountx to 32+amountx ;disable x scroll for this entirely for the right side
- for tempy=amounty to 30+amounty
- x=(tempx-1)*16
- y=(tempy-1)*16
- xdraw=x-SCROLLX
- ydraw=y-SCROLLY
- ink rgb(0, 255, 0)
- ;box x, y, x+16, y+16, 0
- ;check solid tiles below character
- ;check player on tile
- checkingx=tempx
- checkingy=tempy
- if checkingx>MAPWIDTH then checkingx=MAPWIDTH
- if checkingy>MAPHEIGHT then checkingy=MAPHEIGHT
- if map(checkingx, checkingy)=1 ;if the tile is solid, check against player collision
- checkingx1=solids(checkingx, checkingy).x1
- checkingy1=solids(checkingx, checkingy).y1
- checkingx2=solids(checkingx, checkingy).x2
- checkingy2=solids(checkingx, checkingy).y2
- if dixiemounted=false
- playerx1=charx
- playery1=chary
- playerx2=charx+spritewidth
- playery2=chary+spriteheight
- endif
- if dixiemounted=true
- playerx1=rambix
- playery1=rambiy
- playerx2=rambix+64
- playery2=rambiy+64
- endif
- //Maybe this will fix the scrolling issues
- if crateopened=true
- playerx1=squitterx
- playery1=squittery
- playerx2=squitterx+32
- playery2=squittery+32
- endif
- if spinning=true
- gspeed=fallspeed/2
- if gspeed>maxhelicopterfall then gspeed=maxhelicopterfall
- else
- gspeed=fallspeed
- endif
- if dixieblasted=true
- if dixieblasteddirection=2
- gspeed=dixieblastedspeed+1
- endif
- endif
- if playerx2>checkingx1 ;the players x coordinates align
- if playerx1<checkingx2
- if playery1<checkingy1 ;the players top edge is not past the top of the platform
- if playery2>checkingy1-gspeed ;the players bottom edge IS past the top of the platform-1 pixel
- landed=true
- fallspeed=0
- spunalready=false
- spinning=false
- spinframe=1
- spinfallspeed=0
- falling=false
- dixieblasted=false
- dixieblastedspeed=0
- dixieblasteddirection=1
- jumping=false
- endif
- endif
- endif
- endif
- ;check for left and right sides
- ;check left collision (Player is here --> ||Colliding with LEFT wall of object)
- if playerx2>checkingx1-8
- if playerx2<checkingx1+8
- if playery2>checkingy1
- if playery1<checkingy2
- moveright=false
- else
- moveright=true
- endif
- endif
- endif
- endif
- ;check right collision
- if playerx1>checkingx2-8
- if playerx1<checkingx2+8
- if playery2>checkingy1
- if playery1<checkingy2
- moveleft=false
- else
- moveleft=true
- endif
- endif
- endif
- endif
- endif
- if mode$="Collision" ;only place tiles if mode is collision
- if mouseinbox(xdraw, ydraw, xdraw+16, ydraw+16)
- if rightmousebutton()
- charx=x
- chary=y
- endif
- endif
- if menu=1
- if leftmousebutton()
- if mouseinbox(xdraw, ydraw,xdraw+16, ydraw+16)
- ;box x, y, x+16, y+16, 0
- map(checkingx, checkingy)=1
- solids(checkingx, checkingy).x1=x
- solids(checkingx, checkingy).y1=y
- solids(checkingx, checkingy).x2=x+16
- solids(checkingx, checkingy).y2=y+16
- endif
- endif
- endif
- endif
- next tempy
- next tempx
- for temp=1 to 100 ;check barrel collision
- x1=barrels(temp).x1
- y1=barrels(temp).y1
- x2=x1+barrelwidth
- y2=y1+barrelheight
- if mouseinbox(x1-scrollx, y1-scrolly, x2-scrollx, y2-scrolly)
- inbox=true
- lastbarrelx1=x1
- lastbarrely1=y1
- lastbarrelx2=x2
- lastbarrely2=y2
- lastbarrelnumber=temp
- text 200, 570, "Barrel number= "+str$(lastbarrelnumber)
- text 200, 580, "Barrel X1= "+str$(x1) +"Barrel X2= "+str$(x2)
- text 200, 590, "Barrel Y1= "+str$(y1) +"Barrel Y2= "+str$(y2)
- if spacekey()
- barrels(temp).x1=mousex()+scrollx-20
- barrels(temp).y1=mousey()+scrolly-20
- endif
- endif
- amountx=x1
- amounty=y1
- amountx=roundup(amountx/16) ;get the tile number of x
- amounty=roundup(amounty/16) ;get the tile number of y
- for tempx=amountx-3 to amountx+3
- for tempy=amounty-3 to amounty+3
- checkingx=tempx
- checkingy=tempy
- if checkingx>MAPWIDTH then checkingx=MAPWIDTH
- if checkingy>MAPHEIGHT then checkingy=MAPHEIGHT
- if checkingx<1 then checkingx=1
- if checkingy<1 then checkingy=1
- if map(checkingx, checkingy)=1 ;if the tile is solid, check against player collision
- checkingx1=solids(checkingx, checkingy).x1
- checkingy1=solids(checkingx, checkingy).y1
- checkingx2=solids(checkingx, checkingy).x2
- checkingy2=solids(checkingx, checkingy).y2
- bspeed=barrels(temp).fallspeed
- ;only try to handle barrels on screen
- if x2>checkingx1
- if x1<checkingx2
- if y1<checkingy1
- if y2>checkingy1-checkspeed
- barrels(temp).landed=true
- barrels(temp).fallspeed=1
- barrels(temp).falling=false
- barrels(temp).state=2
- endif
- endif
- endif
- endif
- endif
- next tempy
- next tempx
- playerx1=charx
- playery1=chary
- playerx2=charx+spritewidth
- playery2=chary+spriteheight
- if dixieaction=1 ;facing right
- if playerx2>x1-3
- if playerx2<x1+3
- if playery2>y1
- if playery1<y2
- if spacekey() ;check if dixie is on right side of barrel and holding space key
- if landed=true
- dixieholdingbarrel=true
- barrels(temp).draw=false
- dixiepickupbarrelframe=1
- pickingup=true
- pickedupbarrel=temp
- endif
- endif
- endif
- endif
- endif
- endif
- endif
- if dixieaction=2 ;facing left
- if playerx1>x2-3
- if playerx1<x2+3
- if playery2>y1
- if playery1<y2
- if spacekey() ;check if dixie is on left side of barrel and holding space key
- if landed=true
- dixieholdingbarrel=true
- barrels(temp).draw=false
- dixiepickupbarrelframe=1
- pickingup=true
- pickedupbarrel=temp
- endif
- endif
- endif
- endif
- endif
- endif
- endif
- next temp
- if mode$<>"playmode"
- if rightkey()
- scrollx=scrollx+12
- scrollimage backdrop, -6, 0
- scrollimage sky, -3, 0
- endif
- if leftkey()
- scrollx=scrollx-12
- scrollimage backdrop, 6, 0
- scrollimage sky, 3, 0
- endif
- endif
- if falling=true ; set the spinning flag if falling and upkey is pressed
- if spinning=false
- if spunalready=false
- if landed=false
- if spacekey()
- spinning=true
- spunalready=true
- oldfallspeed=fallspeed
- fallspeed=1
- endif
- endif
- endif
- endif
- endif
- ; if upkey is held player is spinning
- if falling=true or jump=true
- if spinning=true
- if spunalready=true
- if landed=false
- if spacekey()
- spinning=true
- oldfallspeed=fallspeed
- jump=false
- else
- spinning=false
- fallspeed=oldfallspeed
- endif
- endif
- endif
- endif
- endif
- if spinning=true
- if timer()>spinframetimer
- spinframetimer=timer()+30
- spinframe=spinframe+1
- if spinframe>10 then spinframe=1
- endif
- endif
- if dixieholdingbarrel=true ;this handles dixie's frame animations for her facing right direction while picking up a barrel!
- if pickingup=true
- if dixiepickupbarrelframe<14 ;she can't move while picking things up!!! silly dixie kong
- moveright=false
- moveleft=false
- jump=false
- jumptime=0
- else
- moveright=true
- endif
- if timer()>bholdframetimer
- bholdframetimer=timer()+30
- dixiepickupbarrelframe=dixiepickupbarrelframe+1
- endif
- if dixiepickupbarrelframe>14 then dixiepickupbarrelframe=14
- endif
- endif
- if puttingdown=true
- if dixiepickupbarrelframe>1
- moveright=false
- moveleft=false
- jump=false
- jumptime=0
- else
- moveright=true
- moveleft=true
- endif
- if timer()>bholdframetimer
- bholdframetimer=timer()+30
- dixiepickupbarrelframe=dixiepickupbarrelframe-1
- endif
- if dixiepickupbarrelframe<=1
- dixiepickupbarrelframe=1
- dixieholdingbarrel=false
- puttingdown=false
- pickingup=false
- if dixieaction=1 ;facing right
- barrels(pickedupbarrel).x1=charx+spritewidth-6
- barrels(pickedupbarrle).state=2
- else
- if dixieaction=2 ;facing left
- barrels(pickedupbarrel).x1=charx-spritewidth+6
- barrels(pickedupbarrel).state=2
- endif
- endif
- barrels(pickedupbarrel).y1=chary-spriteheight+8
- barrels(pickedupbarrel).draw=true
- barrels(pickedupbarrel).falling=true
- barrels(pickedupbarrel).landed=false
- endif
- endif
- if mode$="playmode"
- if jump=false
- if landed=false
- if dixieblasted=false
- ;handle character falling
- if falling=true
- if spinning=true
- spinfallspeed=fallspeed/2
- ;quick patch fall speed to max helicopter speed
- ;only fall if dixieblasted=false
- if spinfallspeed>maxhelicopterfall then spinfallspeed=maxhelicopterfall
- chary=chary+spinfallspeed
- else
- chary=chary+fallspeed
- if dixiemounted=true
- rambiy=rambiy+fallspeed
- if inkey$()=" "
- dixiemounted=false
- endif
- endif
- if crateopened=true
- squittery=squittery+fallspeed
- endif
- endif
- if chary=>480/2 ;sloppy attempt at keeping the player centered on camera
- if spinning=false
- scrolly=scrolly+fallspeed
- scrollimage backdrop, 0, -fallspeed
- scrollimage sky, 0, -fallspeed/2
- else
- scrolly=scrolly+spinfallspeed
- scrollimage backdrop, 0, -spinfallspeed
- scrollimage sky, 0, -spinfallspeed/2
- endif
- endif
- endif
- endif ;only execute character falling code if landed is false.
- endif
- endif ;end the code for jumping
- endif
- ink rgb(0, 0, 255); blue
- ink rgb(255, 255, 255)
- ;for temp=1 to roundup(640/163)
- ;drawimage wall, (temp-1)*163, wally, 0
- ;next temp
- ;rendertoimage myimage
- ;getimage myimage, 0+scrollx, 0+scrolly, 640+scrollx , 480+scrolly
- ;make sure it doesn't scroll past the left or right side too far
- if scrollx<=0 then scrollx=0
- ;if scrollx+640=>WIDTH then scrollx=WIDTH-640
- ;make sure it doesn't scroll past the top or bottom side too far
- if scrolly<=0 then scrolly=0
- if scrolly+480=>HEIGHT then scrolly=HEIGHT-480
- rendertoscreen
- ;box charx, chary, charx+16, chary+16, 0
- if dixiemounted=true //this should patch it
- charx=rambix // so that the engine
- chary=rambiy-32 //indirectly changes dixie's coordinates
- endif //in the case she is riding rambi WHAT A CLUSTER FUCK OF CODE THIS HAS BECOME
- if crateopened=true
- squitterx=charx
- squittery=chary
- endif
- charx1=charx
- chary1=chary
- charx2=charx+spritewidth
- chary2=chary+spriteheight
- charx1=charx1-scrollx
- chary1=chary1-scrolly
- charx2=charx2-scrollx
- chary2=chary2-scrolly
- for tempx=1 to 2
- for tempy=1 to 2
- drawimage sky, (tempx-1)*256, (tempy-1)*256, 0
- drawimage backdrop, (tempx-1)*256, (tempy-1)*256, 1
- next tempy
- next tempx
- drawimage myimage, 0, 0, 1
- drawimage mode, 0, 500, 0
- drawimage save, 0, 600, 0
- drawimage playmode, 0, 700, 0
- if timer()>bananatimer
- bananatimer=timer()+30
- pushframes=true
- endif
- //Let's just shorten this more and we'll seperate bananas even more later ^^;
- amountx=roundup(tileboxoffsetx/32)
- if amountx<1 then amountx=1
- ink rgb(255, 0, 0)
- tile_to_draw=amountx*26
- for tempx=amountx to 23+amountx
- for tempy=1 to 26
- if tile_to_draw>598 then tile_to_draw=598
- if tile_to_draw<1 then tile_to_draw=1
- if menu=1
- drawimage tiles(tile_to_draw), (tempx-1)*32+530-tileboxoffsetx, (tempy-1)*32-tileboxoffset, 0
- endif
- ;dx1=((tempx-1)*32)+530-tileboxoffsetx
- ;dy1=(tempy-1)*32-tileboxoffset
- ;dx2=(tempx*32)+530-tileboxoffsetx
- ;dy2=tempy*32-tileboxoffset
- ;boxc dx1, dy1, dx2, dy2, 0, rgb(255, 0, 0)
- if mouseinbox( ((tempx-1)*32)+530-tileboxoffsetx, (tempy-1)*32-tileboxoffset, (tempx*32)+530-tileboxoffsetx, tempy*32-tileboxoffset )
- if leftmousebutton()
- if menu=1
- currenttile=tile_to_draw
- endif
- endif
- if keystate(29) ;left control key
- if leftmousebutton()
- if menu=1
- if multiple_selected=false
- multiple_selected=true
- tiles_selected=1
- dim tiles_list(1)
- tiles_list(tiles_selected)=tile_to_draw
- endif
- if last_tile<>tile_to_draw
- tiles_list(tiles_selected)=tile_to_draw
- last_tile=tile_to_draw
- tiles_selected=tiles_selected+1
- redim tiles_list(tiles_selected)
- endif
- endif
- endif
- endif
- endif
- tile_to_draw=tile_to_draw+1
- next tempy
- next tempx
- if SCROLLX=>16
- amountx=roundup(SCROLLX/16)
- else
- amountx=1
- endif
- ;top side same thing as above
- if SCROLLY=>16
- amounty=roundup(SCROLLY/16)
- else
- amounty=1
- endif
- if 32+amountx>MAPWIDTH
- MAPWIDTH=32+amountx
- redim map(MAPWIDTH, MAPHEIGHT)
- endif
- if 30+amounty>MAPHEIGHT
- MAPHEIGHT=32+amounty
- redim map(MAPWIDTH, MAPHEIGHT)
- endif
- for tempx=amountx to 32+amountx ;disable x scroll for this entirely for the right side
- for tempy=amounty to 30+amounty
- draw=map(tempx, tempy)
- if draw=1
- x=(tempx-1)*16
- y=(tempy-1)*16
- xdraw=x-SCROLLX
- ydraw=y-SCROLLY
- ink rgb(0, 255, 0)
- box xdraw, ydraw, xdraw+16, ydraw+16, 0
- endif
- next tempy
- next tempx
- if SCROLLX=>32
- amountx=roundup(SCROLLX/32)
- else amountx=1
- endif
- ;top side same thing as above
- if SCROLLY=>32
- amounty=roundup(SCROLLY/32)
- else
- amounty=1
- endif
- if 17+amountx>MAPWIDTH/2
- redim tilemap(amountx+17, MAPHEIGHT/2)
- endif
- if 16+amounty>MAPHEIGHT/2
- redim tilemap(MAPWIDTH/2, amounty+16)
- endif
- for tempx=amountx to amountx+17
- for tempy=amounty to amounty+16
- x=(tempx-1)*32
- y=(tempy-1)*32
- xdraw=x-SCROLLX
- ydraw=y-SCROLLY
- if TILEMAP(tempx, tempy)>0
- tile_this_tile=TILEMAP(tempx, tempy)
- drawimage tiles(tile_this_tile), xdraw, ydraw, 1
- endif
- if mode$="tile_mode"
- if mouseinbox(0 ,0 ,500, 480)
- if mouseinbox( xdraw, ydraw, xdraw+32, ydraw+32 )
- if leftmousebutton()
- TILEMAP(tempx, tempy)=currenttile
- if multiple_selected=true
- amount=tiles_selected
- for temp=1 to amount
- to_draw=tiles_list(temp)
- if to_draw<1 then to_draw=1
- TILEMAP(tempx-1+temp, tempy)=to_draw
- next temp
- endif
- endif
- endif
- ;sync
- endif
- endif
- next tempy
- next tempx
- if multiple_selected=true
- amount=tiles_selected
- for temp=1 to amount
- to_draw=tiles_list(temp)
- if to_draw<1 then to_draw=1
- drawimage tiles(to_draw), mousex()+(temp-1)*32, mousey(), 1
- next temp
- endif
- if keystate(157)
- multiple_selected=false
- endif
- ink rgb(0, 0, 255) ;blue character
- ;box charx1, chary1, charx2, chary2, 1
- ;;
- if dixiemounted=false
- boxx1=charx1
- boxy1=chary1
- boxx2=charx2
- boxy2=chary2
- endif
- if dixiemounted=true
- boxx1=rambix
- boxy1=rambiy
- boxx2=rambix+64
- boxy2=rambiy+64
- boxx1=boxx1-scrollx
- boxy1=boxy1-scrolly
- boxx2=boxx2-scrollx
- boxy2=boxy2-scrolly
- endif
- if crateopened=true
- boxx1=squitterx
- boxy1=squittery
- boxx2=squitterx+32
- boxy2=squittery+32
- boxx1=boxx1-scrollx
- boxy1=boxy1-scrolly
- boxx2=boxx2-scrollx
- boxy2=boxy2-scrolly
- endif
- box boxx1, boxy1, boxx2, boxy2, 0
- if dixiemounted=false
- if dixieaction=1 ;only draw if dixie is facing right
- if dixieholdingbarrel=true
- drawimage dixiepickupbarrelright(dixiepickupbarrelframe), charx1, chary1-48, 1
- endif
- endif
- endif
- if dixiemounted=false
- if dixieholdingbarrel=false
- if dixieaction=1
- if landed=true
- drawimage dixieright(dixieframe), charx1, chary1-spriteheight/2, 1
- else
- if jump=true
- drawimage dixiejumpright(jumpframe), charx1, chary1-36, 1
- else
- if spinning=false
- drawimage dixiejumpright(4), charx1, chary1-36, 1
- else
- drawimage dixiespinright(spinframe), charx1, chary1-spriteheight/2, 1
- endif
- endif
- endif
- endif
- endif
- endif
- if dixiemounted=false
- if dixieaction=2 ;only draw if dixie is facing left
- if dixieholdingbarrel=true
- drawimage dixiepickupbarrelleft(dixiepickupbarrelframe), charx1-spritewidth, chary1-48, 1
- endif
- endif
- endif
- if dixiemounted=false
- if dixieholdingbarrel=false
- if dixieaction=2
- if landed=true
- drawimage dixieleft(dixieframe), charx1-16, chary1-spriteheight/2, 1
- else
- if jump=true
- drawimage dixiejumpleft(jumpframe), charx1-16, chary1-36, 1
- else
- if spinning=false
- drawimage dixiejumpleft(4), charx1-16, chary1-36, 1
- else
- drawimage dixiespinleft(spinframe), charx1, chary1-spriteheight/2, 1
- endif
- endif
- endif
- endif
- endif
- endif
- ink rgb(0, 255, 255) ;white
- if dixiemounted=false
- drawimage rambi_run_right(1), rambix-scrollx, rambiy-scrolly, 1
- endif
- if dixiemounted=true
- if dixieaction=1
- drawimage rambi_run_right(rambiframe), rambix-scrollx, rambiy-scrolly, 1
- drawimage dixiemountedright, rambix-scrollx, rambiy-spriteheight-scrolly, 1
- endif
- if dixieaction=2
- drawimage rambi_run_left(rambiframe), rambix-scrollx, rambiy-scrolly, 1
- drawimage dixiemountedleft, rambix-scrollx, rambiy-spriteheight-scrolly, 1
- endif
- endif
- checkingx1=charx
- checkingy1=chary
- checkingx2=charx+spritewidth
- checkingy2=chary+spriteheight
- if checkingx2>rambix
- if checkingx1<rambix+32
- if checkingy2>rambiy
- if checkingy1<rambiy+32
- dixiemounted=true
- endif
- endif
- endif
- endif
- //Here we're going to check for collision with the squitter rate
- //
- if falling=true //We only want this to work if dixie is falling.
- if checkingx2>squitterCrateX
- if checkingx1<squittercrateX+106
- if checkingy2>squitterCrateY
- if checkingY1<SquitterCrateY+60
- //Summon Squitter!!!
- CrateOpened=true
- //This will only happen on the first frame
- if squittercrateframe<2
- SquitterX=SquitterCrateX+50
- SquitterY=SquitterCrateY
- //falling=false
- //landed=true
- //dixieblasted=true
- //dixieblastedspeed=11
- //dixieblasteddirection=1
- endif
- //This check should stop the sound from looping
- //Even if the collision still happens! That would've sucked huh?
- if squittercrateframe<2
- playsound Crateopens;
- endif
- endif
- endif
- endif
- endif
- endif
- //Directly below here we deal with the crate opening
- if CrateOpened=true
- if squittercrateframe<3 then squittercrateframe=Squittercrateframe+1
- endif
- if keystate(72)
- tileboxoffset=tileboxoffset-5
- endif
- if keystate(80)
- tileboxoffset=tileboxoffset+5
- endif
- if keystate(77)
- tileboxoffsetx=tileboxoffsetx+5
- endif
- if keystate(75)
- tileboxoffsetx=tileboxoffsetx-5
- endif
- if keystate(42)
- menu=menu-1
- endif
- if keystate(54)
- menu=menu+1
- endif
- if menu<1 then menu=1
- if menu>2 then menu=2
- text 200, 500, "SCROLLY " +str$(Scrolly)+" --ROUNDED to tile index: "+str$(amounty)
- text 200, 520, "SCROLLX " +str$(Scrollx)+" --ROUNDED to tile index: "+str$(amountx)
- text 200, 540, "This is the result of WIDTH <> scroll X"+str$(WIDTH-(640+scrollx))+"and"+str$(WIDTH)
- text 200, 560, "Playerx : "+str$(charx)+" Playery : "+str$(chary)
- if inbox=true
- text 200, 570, "Barrel number= "+str$(lastbarrelnumber)
- text 200, 580, "Barrel X1= "+str$(x1) +"Barrel X2= "+str$(x2)
- text 200, 590, "Barrel Y1= "+str$(y1) +"Barrel Y2= "+str$(y2)
- endif
- text 200, 600, "RambiX= "+str$(rambix) + "RambiY= "+str$(rambiy)
- box (mousex()), (mousey()), mousex()+32, mousey()+32, 0
- if mouseinbox(0, 500, 0+128, 564)
- if leftmousebutton()
- mode$="Collision"
- endif
- endif
- if mouseinbox(0, 700, 0+(128*3), 764)
- if leftmousebutton()
- mode$="playmode"
- falling=true
- endif
- endif
- if mouseinbox(0, 600, 0+(128*2), 664)
- if leftmousebutton()
- if fileexist("C:/brambles_map3.txt")
- deletefile ("C:/brambles_map3.txt")
- endif
- writefile "levels\brambles_map3.txt", 1
- writeint 1, Mapwidth
- writeint 1, mapheight
- writeint 1, charx
- writeint 1, chary
- writeint 1, scrollx
- writeint 1, scrolly
- for tempx=1 to Mapwidth
- for tempy=1 to mapheight
- writeint 1, map(tempx, tempy)
- writeint 1, solids(tempx, tempy).x1
- writeint 1, solids(tempx, tempy).y1
- writeint 1, solids(tempx, tempy).x2
- writeint 1, solids(tempx, tempy).y2
- next tempy
- next tempx
- for tempx=1 to MAPWIDTH/2
- for tempy=1 to MAPHEIGHT/2
- writeint 1, TILEMAP(tempx, tempy)
- next tempy
- next tempx
- for temp=1 to 30
- writeint 1, b_barrels(temp).facing_type
- writeint 1, b_barrels(temp).x1
- writeint 1, b_barrels(temp).y1
- writeint 1, b_barrels(temp).x2
- writeint 1, b_barrels(temp).y2
- next temp
- closefile 1
- endif
- endif
- ;scrolling input
- if dixiemounted=false
- if leftkey()
- ;scrollx=scrollx-8
- dixieaction=2
- if timer()>frametimer
- dixieframe=dixieframe+1
- if dixieframe>16 then dixieframe=1
- frametimer=timer()+30
- endif
- if moveleft=true
- charx=charx-8
- if charx>320
- if charx<WIDTH-320
- scrollimage backdrop, 4, 0
- scrollimage sky, 2, 0
- endif
- endif
- ;scrollx=scrollx-1
- endif
- endif
- endif
- if dixiemounted=false
- if rightkey()
- ;scrollx=scrollx+8
- dixieaction=1
- if timer()>frametimer
- dixieframe=dixieframe+1
- if dixieframe>16 then dixieframe=1
- frametimer=timer()+30
- endif
- if moveright=true
- charx=charx+8
- if charx<WIDTH-320
- if charx>320
- scrollimage backdrop, -4, 0
- scrollimage sky, -2, 0
- endif
- endif
- ;scrollx=scrollx+1
- endif
- endif
- endif
- //the above was the movement code for dixie not being mounted.
- //here is the code for when dixie is mounted
- if dixiemounted=true
- if leftkey()
- ;scrollx=scrollx-8
- dixieaction=2
- if timer()>frametimer
- rambiframe=rambiframe+1
- if rambiframe>15 then rambiframe=1
- frametimer=timer()+30
- endif
- //if moveleft=true
- rambix=rambix-8
- charx=charx-8
- if rambix>320
- if rambix<WIDTH-320
- scrollimage backdrop, 4, 0
- scrollimage sky, 2, 0
- endif
- endif
- ;scrollx=scrollx-1
- endif
- endif
- //endif
- if dixiemounted=true
- if rightkey()
- ;scrollx=scrollx+8
- dixieaction=1
- if timer()>frametimer
- rambiframe=rambiframe+1
- if rambiframe>15 then rambiframe=1
- frametimer=timer()+30
- endif
- //if moveright=true
- rambix=rambix+8
- charx=charx+8
- if rambix<WIDTH-320
- if rambix>320
- scrollimage backdrop, -4, 0
- scrollimage sky, -2, 0
- endif
- endif
- ;scrollx=scrollx+1
- //endif
- endif
- endif
- //on rambi
- //now on squitter
- if openedcrate=true
- if rightkey()
- if dixieaction=1
- //if moveright=true
- squitterx=squitterx+8
- charx=charx+8
- squitterframe=squitterframe+1
- //endif
- endif
- endif
- if leftkey()
- if dixieaction=2
- //if moveleft=true
- squitterx=squitterx-8
- charx=charx-8
- //endif
- endif
- endif
- endif
- //End checking if the crate is opened here
- if mode$<>"playmode"
- if downkey()
- scrolly=scrolly+12
- scrollimage backdrop, 0, -6
- scrollimage sky, 0, -3
- endif
- if upkey()
- scrolly=scrolly-12
- scrollimage backdrop, 0, 6
- scrollimage sky, 0, 3
- endif
- endif
- if mode$="playmode"
- if jump=false
- if upkey()
- if landed=true
- jump=true
- upforce=30
- jumpframetimer=timer()+30
- endif
- endif
- endif
- if jump=true
- if dixiemounted=true
- chary=chary-(upforce*0.60)
- rambiy=rambiy-(upforce*0.60)
- scrolly=scrolly-(upforce*0.60)
- scrollimage backdrop, 0, (upforce*0.60)/2
- scrollimage sky, 0, (upforce*0.60)/4
- upforce=upforce-2
- endif
- if crateopened=true
- chary=chary-(upforce*0.6)
- squittery=squittery-(upforce*0.060)
- scrolly=scrolly-(upforce*0.60)
- upforce=upforce-2
- endif
- if dixiemounted=false
- chary=chary-(upforce*0.60)
- scrolly=scrolly-(upforce*0.60)
- scrollimage backdrop, 0, (upforce*0.60)/2
- scrollimage sky, 0, (upforce*0.60)/4
- upforce=upforce-2
- endif
- if timer()>jumpframetimer
- jumpframe=jumpframe+1
- if jumpframe>4 then jumpframe=4
- jumpframetimer=timer()+30
- endif
- endif
- state=upkey()
- if state=false
- upforce=0
- endif
- if jump=true
- if upforce=<0
- jump=false
- upforce=0
- fallspeed=7
- endif
- endif
- endif
- falling=true
- landed=false
- ;moveright=true
- ;draw barrels
- for temp=1 to 100
- x=barrels(temp).x1
- y=barrels(temp).y1
- bfalling=barrels(temp).falling
- blanded=barrels(temp).landed
- draw=barrels(temp).draw
- btimer=barrels(temp).falltimer
- state=barrels(temp).state
- frame=barrels(temp).frame
- tmr=barrels(temp).frametimer
- if blanded=false
- if bfalling=true
- if timer()>btimer
- barrels(temp).falltimer=timer()+100
- barrels(temp).fallspeed=barrels(temp).fallspeed+1
- if barrels(temp).fallspeed>3 then barrels(temp).fallspeed=3
- endif
- bfallspeed=barrels(temp).fallspeed
- barrels(temp).y1=barrels(temp).y1+bfallspeed
- endif
- endif
- if timer()>tmr
- barrels(temp).frame=barrels(temp).frame-1
- if barrels(temp).frame<1 then barrels(temp).frame=7
- if blanded=true or blanded=1 then barrels(temp).x1=barrels(temp).x1+8
- endif
- if draw=true
- if state=1
- drawimage barreli, x-scrollx, y-scrolly, 1
- endif
- if state=2
- drawimage rolling_barrel(frame), x-scrollx, y-scrolly, 1
- endif
- endif
- next temp
- //Here I want to deal with the crate
- //We'll just make sure the crate frame does not exceed 2 frames
- if SquitterCrateFrame>3 then SquitterCrateFrame=2;
- drawimage squittercrate(SquitterCrateFrame), SquitterCrateX-scrollx, SquitterCrateY-scrolly, 1
- drawimage squitterwalkright(squitterframe), SquitterX-scrollx, Squittery-scrolly, 1
- squitterframe=squitterframe+1
- if squitterframe=>16 then squitterframe=1
- ///
- //New object code starts HERE (2015 yahhh!!!)
- ///Try to call draw zingers from here yep
- //Handle beatles after this, make sure to pass mode$ to it
- //Handle Krooks after this (collision)
- if menu=2
- drawimage barrel_(1), 564, 0, 1
- drawimage barrel_(2), 628, 0, 1
- drawimage barrel_(3), 564, 64, 1
- drawimage barrel_(4), 628, 64, 1
- drawimage obj_hook, 628+64, 96, 1
- if mouseinbox(564, 0, 628, 64)
- if leftmousebutton()
- barrel_selected=1
- obj_selected=1
- endif
- endif
- if mouseinbox(628, 0, 692, 64)
- if leftmousebutton()
- barrel_selected=2
- obj_selected=1
- endif
- endif
- if mouseinbox(564, 64, 628, 128)
- if leftmousebutton()
- barrel_selected=3
- obj_selected=1
- endif
- endif
- if mouseinbox(628, 64, 692, 128)
- if leftmousebutton()
- barrel_selected=4
- obj_selected=1
- endif
- endif
- if mouseinbox(628+64, 64, 628+64+16, 628+64+31)
- if leftmousebutton()
- obj_selected=2
- endif
- endif
- //The testbarrel is here
- if leftmousebutton()
- testing_barrel_x=mousex()+scrollx
- testing_barrel_y=mousey()+scrolly
- rambix=mousex()+scrollx
- rambiy=mousey()+scrolly
- //SquitterCrateX=mousex()+scrollx
- //SquitterCrateY=mousey()+scrolly
- endif
- if obj_selected=1
- if barrel_selected<1 then barrel_selected=1
- drawimage barrel_(barrel_selected), testing_barrel_x-scrollx, testing_barrel_y-scrolly, 1
- if rightmousebutton()
- b_barrels(current_blast_barrel).x1=testing_barrel_x
- b_barrels(current_blast_barrel).y1=testing_barrel_y
- b_barrels(current_blast_barrel).x2=testing_barrel_x+64
- b_barrels(current_blast_barrel).y2=testing_barrel_y+64
- b_barrels(current_blast_barrel).facing_type=barrel_selected
- menu=1
- current_blast_barrel=current_blast_barrel+1
- endif
- endif
- endif
- if obj_selected=2
- drawimage obj_hook, testing_barrel_x-scrollx, testing_barrel_y-scrolly, 1
- if rightmousebutton()
- hooks(current_hook).x1=testing_barrel_x
- hooks(current_hook).y1=testing_barrel_y
- hooks(current_hook).x2=testing_barrel_x+16
- hooks(current_hook).y2=testing_barrel_y+31
- current_hook=current_hook+1
- if current_hook=>30 then current_hook=30
- endif
- endif
- for temp=1 to 30
- checkingx1=b_barrels(temp).x1
- checkingy1=b_barrels(temp).y1
- checkingx2=b_barrels(temp).x2
- checkingy2=b_barrels(temp).y2
- facing=b_barrels(temp).facing_type
- drawimage barrel_(facing), checkingx1-scrollx, checkingy1-scrolly, 1
- box checkingx1-scrollx, checkingy1-scrolly, checkingx2-scrollx, checkingy2-scrolly, 0
- playerx1=charx
- playery1=chary
- playerx2=charx+spritewidth
- playery2=chary+spriteheight
- ;if playerx2>checkingx1-3
- ; if playerx2<checkingx2
- ;if playery2>checkingy1
- ;if playery1<checkingy2
- ;dixieblasted=true
- ;dixieblasteddirection=b_barrels(temp).facing_type
- ;dixieblastedspeed=5
- ; endif
- ;endif
- ; endif
- ; endif
- ;check right collision
- ;if playerx1>checkingx2-3
- ;if playerx1<checkingx2+3
- ;if playery2>checkingy1
- ;if playery1<checkingy2
- ;dixieblasted=true
- ;dixieblasteddirection=b_barrels(temp).facing_type
- ;dixieblastedspeed=5
- ;endif
- ;endif
- ;endif
- ;endif
- if playerx2=>checkingx1
- if playerx1<=checkingx2
- if playery2=>checkingy1
- if playery1<=checkingy2
- dixieblasted=true
- dixieblasteddirection=b_barrels(temp).facing_type
- dixieblastedspeed=50
- playsound blastbarrel
- endif
- endif
- endif
- endif
- next temp
- for temp=1 to 30
- checkingx1=hooks(temp).x1
- checkingy1=hooks(temp).y1
- checkingx2=hooks(temp).x2
- checkingy2=hooks(temp).y2
- drawimage obj_hook, checkingx1-scrollx, checkingy1-scrolly, 1
- next temp
- if dixieblasted=true
- s=dixieblastedspeed
- select dixieblasteddirection
- case 1
- chary=chary-s
- scrollimage backdrop, 0, s/2
- scrollimage sky, 0, s/4
- scrolly=scrolly-s
- case 2
- chary=chary+s
- scrolly=scrolly+s
- scrollimage backdrop, 0, -s/2
- scrollimage sky, 0, -s/4
- case 3
- charx=charx-s
- scrollx=scrollx-s
- scrollimage backdrop, s/2, 0
- scrollimage sky, s/4, 0
- case 4
- charx=charx+s
- scrollx=scrollx+s
- scrollimage backdrop, -s/2, 0
- scrollimage sky, -s/4, 0
- endselect
- dixieblastedspeed=dixieblastedspeed-1
- if dixieblastedspeed<=0
- dixieblasted=false
- endif
- endif
- ;manage camera
- ;only in playmode
- if mode$="playmode"
- if scrollx+640-charx>320 ;left side
- scrollx=scrollx-8
- endif
- if scrolly+480-chary>240 ;top side
- scrolly=scrolly-4
- endif
- if chary-scrolly>240 ;Bottom Side
- scrolly=scrolly+4
- endif
- if charx-scrollx>320 ;Right Side
- scrollx=scrollx+8
- endif
- ;patch in barrel placing
- if rightmousebutton()
- //barrels(1).x1=mousex()+scrollx
- //barrels(1).y1=mousey()+scrolly
- //barrels(1).x2=barrels(1).x1+barrelwidth
- // barrels(1).y2=barrels(1).y1+barrelheight
- //Use this for the crate instead
- SquitterCrateX=mousex()+scrollx
- SquitterCrateY=mousey()+scrolly
- gameobjects(1).X=mousex()+scrollx
- gameobjects(1).y=mousey()+scrolly
- if spacekey()
- barrels(1).falling=true
- endif
- endif
- endif
- if keystate(181)
- mode$="tile_mode"
- endif
- for temp=1 to 250
- //Get object type
- THISTYPE=GAMEOBJECTS(temp).obj_type
- select THISTYPE
- case 1
- handlebanana(bananatimer, pushframes, charx, chary, spritewidth, spriteheight, temp, scrollx, scrolly, bananacollect)
- case 3 //IF CASE THREE THEN GET THE FUCK OUT!!!
- //dim zing as object
- //zing.object=gameobjects(temp).object
- handlezinger(gameobjects().object, temp)
- ///GRR WHY WONT IT CALL IT!!?!?!?!
- //gameobjects(temp).frame=gameobjects(temp).frame+1 //FORCE the frame update skip it in the subroutine fuck it
- drawzinger(temp, scrollx, scrolly, gameobjects().object)
- case 4
- case 5
- handleballoon(pushframes, charx, chary, spritewidth, spriteheight, temp, scrollx, scrolly, gameobjects().object, ballooncollect)
- ENDSELECT
- //iF THISTYPE=3 THEN handlezinger(temp)
- //IF THISTYPE=3 THEN DRAWZINGER(temp, scrollx, scrolly)
- //if temp<50
- //if THISTYPE<>1
- //#print THISTYPE
- // GAMEOBJECTS(temp).obj_type=1
- // endif
- //endif
- next temp
- //This belongs here not up there god damnit
- pushframes=false
- sync
- cls rgb(0,0,0)
- loop
- //Handle a SINGLE Beatle Collision
- function beatle_collision(object_number, MAPWIDTH, MAPHEIGHT)
- x1=GameObjects(object_number).x1
- y1=GameObjects(object_number).y1
- x2=x1+48
- y2=y1+32
- ;landed=beatles(temp).landed ;today I found this glitch. The players collision check WAS registering. But this bugger was changing it to whatever the value of the last beatle checked is. BUGGER!
- falling=GameObjects(object_number).falling
- ftimer=GameObjects(object_number).frametimer
- facing=GameObjects(object_number).facing
- if timer()>ftimer
- GameObjects(object_number).frame=GameObjects(object_number).frame+1
- GameObjects(object_number).frametimer=timer()+30
- endif
- if GameObjects(object_number).frame>8 then GameObjects(object_number).frame=1
- amountx=x1
- amounty=y1
- amountx=roundup(amountx/16) ;get the tile number of x
- amounty=roundup(amounty/16) ;get the tile number of y
- for tempx=amountx-2 to amountx+2
- for tempy=amounty-2 to amounty+2
- checkingx=tempx
- checkingy=tempy
- if checkingx>MAPWIDTH then checkingx=MAPWIDTH
- if checkingy>MAPHEIGHT then checkingy=MAPHEIGHT
- if checkingx<1 then checkingx=1
- if checkingy<1 then checkingy=1
- if map(checkingx, checkingy)=1 ;if the tile is solid, check against beatle collision
- checkingx1=solids(checkingx, checkingy).x1
- checkingy1=solids(checkingx, checkingy).y1
- checkingx2=solids(checkingx, checkingy).x2
- checkingy2=solids(checkingx, checkingy).y2
- cpseed=3
- if x2>checkingx1
- if x1<checkingx2
- if y1<checkingy1
- if y2>checkingy1-cspeed
- GameObjects(object_number).landed=true
- GameObjects(object_number).falling=false
- endif
- endif
- endif
- endif
- endif
- next tempy
- next tempx
- endfunction
- function draw_blank_tiles()
- for tempx=amountx to 20+amountx+1
- for tempy=amounty to 15+amounty+1
- x=(tempx-1)*32
- y=(tempy-1)*32
- xdraw=x-SCROLLX
- ydraw=y-SCROLLY
- ;tilenum=map(tempx, tempy)
- ;print "Tilenum is" +str$(tilenum)
- ;print "Press key to show image"
- ;waitkey
- ;waitnokey
- ;sync
- if tilenum=<0 then tilenum=1
- if tilenum=>101 then tilenum=100
- drawimage tiles(tilenum), xdraw, ydraw, 0
- next tempy
- next tempx
- rendertoscreen
- drawimage timage, 0, 0, 0
- endfunction
- function pushbananaframe(number)
- GameObjects(number).frame=GameObjects(number).frame+1
- if GameObjects(number).frame>8 then GameObjects(number).frame=1
- endfunction
- //Call this from main loop when handling the object
- function handlezinger(gameobjects().object, index)
- //Gnum=object_number
- //#print "This code was reached"
- x1=gameobjects(index).x1
- y1=gameobjects(index).y1
- frame=gameobjects(index).frame
- ftimer=gameobjects(index).frametimer
- directionleft=gameobjects(index).directionleft
- facing=gameobjects(index).facing
- //gameob
- gameobjects(index).frame=gameobjects(index).frame+1
- if gameobjects(index).frame>3 then gameobjects(index).frame=1 //THERE!!
- //#print "Difference between frame timer and current timer is " + str$(ftimer-timer() )
- //#print "The frame for this bee is at " +str$(frame)
- //if spacekey()
- //GameObjects(gnum).frametimer=timer()+30
- //endif
- if timer()>ftimer
- GameObjects(index).frame=GameObjects(index).frame+1
- GameObjects(index).frametimer=timer()+30
- gameobjects(index).directionleft=gameobjects(index).directionleft-1
- endif
- ///Why is this getting messed up? I don't know let's fix it... fuck sakes...
- select facing
- #print "Local object reads as " +str$(facing)
- #print "Actual facing value is " +str$(gameobjects(index).facing)
- case 1
- gameobjects(index).x1=gameobjects(index).x1-3
- //#print "This code was tested"
- if directionleft<=0
- gameobjects(index).facing=2
- gameobjects(index).directionleft=30
- endif
- case 2
- gameobjects(index).x1=gameobjects(index).x1+3
- if directionleft<=0
- gameobjects(index).facing=1
- gameobjects(index).directionleft=30
- endif
- case 0
- facing=1
- endselect
- if gameobjects(index).frame>3 then gameobjects(index).frame=1
- endfunction zinger
- //This handles ONE zinger. It's a draw function. See handlezinger for dealing with the sprites!
- function drawzinger(index, scrollx, scrolly, gameobjects().object)
- //THE DAMN STUPID GAME ENGINE SHOULD BE ABLE TO GET THIS
- frame=gameobjects(index).frame
- ///HOW ABOUT AGAIN!?!
- //#print THISFRAME
- facing=gameobjects(index).facing
- select facing
- case 1
- drawimage zingerfacesleft(frame), gameobjects(index).x1-scrollx, gameobjects(index).y1-scrolly, 1
- case 2
- drawimage zingerfacesright(frame), gameobjects(index).x1-scrollx, gameobjects(index).y1-scrolly, 1
- endselect
- endfunction
- //This handles ONE beatle, pass object number and mode$ to it k thx
- function handlebeatle(object_number, mode$, scrollx, scrolly)
- frame=GameObjects(object_number).frame
- facing=GameObjects(object_number).facing
- blanded=GameObjects(object_number).landed
- bfalling=GameObjects(object_number).falling
- if blanded=false
- if bfalling=true
- if mode$="playmode"
- GameObjects(object_number).y1=GameObjects(object_number).y1+3
- endif
- endif
- endif
- select facing
- case 1
- if blanded=true
- GameObjects(object_number).x1=GameObjects(object_number).x1-2
- endif
- drawimage beatlefacesleft(frame), GameObjects(object_number).x1-scrollx, GameObjects(object_number).y1-scrolly, 1
- case 2
- if blanded=true
- GameObjects(object_number).x1=GameObjects(object_number).x1+2
- endif
- drawimage beatlefacesright(frame), GameObjects(object_number).x1-scrollx, GameObjects(object_number).y1-scrolly, 1
- endselect
- GameObjects(object_number).falling=true
- GameObjects(object_number).landed=false
- endfunction
- function handlebanana(bananatimer, pushframes, charx, chary, spritewidth, spriteheight, object_number, scrollx, scrolly, bananacollect)
- number=object_number
- xx=scrollx
- yy=scrolly
- frame=GameObjects(number).frame
- if frame>8 then frame=8
- if frame<1 then frame=1
- x=GameObjects(number).x
- y=GameObjects(number).y
- collected=GameObjects(number).collected
- if collected=false
- drawimage bananaframes(frame), x-xx, y-yy, 1
- if pushframes=true
- pushbananaframe(number)
- endif
- endif
- if charx+spritewidth=>x
- if chary+spriteheight=>y
- if charx<x+16
- if chary<y+16
- if GameObjects(numer).collected=false
- playsound bananacollect
- endif
- GameObjects(number).collected=true
- endif
- endif
- endif
- endif
- endfunction
- function handleballoon(pushframes, charx, chary, spritewidth, spriteheight, object_number, scrollx, scrolly, gameobjects().object, ballooncollect)
- number=object_number
- xx=scrollx
- yy=scrolly
- frame=GameObjects(number).frame
- if frame>5 then frame=5
- if frame<1 then frame=1
- x=GameObjects(number).x
- y=GameObjects(number).y
- collected=GameObjects(number).collected
- if collected=false
- drawimage balloon(frame), x-xx, y-yy, 1
- //We'll borrow the banana's frame timer for now it might be smoother
- if pushframes=true
- pushbananaframe(number)
- endif
- endif
- if charx+spritewidth=>x
- if chary+spriteheight=>y
- if charx<x+16
- if chary<y+16
- if Gameobjects(number).collected=false
- playsound ballooncollect
- endif //The sound should only play once!
- GameObjects(number).collected=true
- endif
- endif
- endif
- endif
- endfunction
- //Handle a SINGLE Krook
- function handle_krooks(object_number, scrollx, scrolly)
- //Handle a SINGLE Krook collision
- frame=GameObjects(object_number).frame
- facing=GameObjects(object_number).facing
- klanded=GameObjects(object_number).landed
- kfalling=GameObjects(object_number).falling
- if klanded=false
- if kfalling=true
- if mode$="playmode"
- GameObjects(object_number).y1=GameObjects(object_number).y1+3
- endif
- endif
- endif
- select facing
- case 1
- if klanded=true
- GameObjects(object_number).x1=GameObjects(object_number).x1-2
- endif
- drawimage krook_walk_left(frame), GameObjects(object_number).x1-scrollx, GameObjects(object_number).y1-scrolly, 1
- case 2
- if klanded=true
- GameObjects(object_number).x1=GameObjects(object_number).x1+2
- endif
- drawimage krook_walk_right(frame), GameObjects(object_number).x1-scrollx, GameObjects(object_number).y1-scrolly, 1
- endselect
- GameObjects(object_number).falling=true
- GameObjects(object_number).landed=false
- x2=GameObjects(object_number).x1+95
- y2=GameObjects(object_number).y1+56
- ink rgb(255, 255, 255)
- box GameObjects(object_number).x1-scrollx, GameObjects(object_number).y1-scrolly, x2-scrollx, y2-scrolly, 0
- endfunction
- //Handle a SINGLE Krook Collision!!
- function krook_collision(object_number)
- x1=GameObjects(object_number).x1
- y1=GameObjects(object_number).y1
- x2=x1+95
- y2=y1+56
- ;landed=beatles(temp).landed ;today I found this glitch. The players collision check WAS registering. But this bugger was changing it to whatever the value of the last beatle checked is. BUGGER!
- falling=GameObjects(object_number).falling
- ftimer=GameObjects(object_number).frametimer
- facing=GameObjects(object_number).facing
- if timer()>ftimer
- GameObjects(object_number).frame=GameObjects(object_number).frame+1
- GameObjects(object_number).frametimer=timer()+5
- endif
- if GameObjects(object_number).frame>11 then GameObjects(object_number).frame=1
- amountx=x1
- amounty=y1
- amountx=roundup(amountx/16) ;get the tile number of x
- amounty=roundup(amounty/16) ;get the tile number of y
- for tempx=amountx-4 to amountx+4 //NOTE for larger enemies or hitboxes this range will need to be larger
- for tempy=amounty-4 to amounty+4 //NOTE for larger enemies or hitboxes this range will need to be larger
- checkingx=tempx
- checkingy=tempy
- if checkingx>MAPWIDTH then checkingx=MAPWIDTH
- if checkingy>MAPHEIGHT then checkingy=MAPHEIGHT
- if checkingx<1 then checkingx=1
- if checkingy<1 then checkingy=1
- if map(checkingx, checkingy)=1 ;if the tile is solid, check against beatle collision
- checkingx1=solids(checkingx, checkingy).x1
- checkingy1=solids(checkingx, checkingy).y1
- checkingx2=solids(checkingx, checkingy).x2
- checkingy2=solids(checkingx, checkingy).y2
- cpseed=3
- if x2>checkingx1
- if x1<checkingx2
- if y1<checkingy1
- if y2>(checkingy1)-cspeed
- GameObjects(object_number).landed=true
- GameObjects(object_number).falling=false
- endif
- endif
- endif
- endif
- endif
- next tempy
- next tempx
- endfunction
- /// these are loops and functions for testing only. PASTE ABOVE LOADING TO TEST::
- frametimer=timer()+10
- dkcoinframe=1
- littleloop:
- if dkcoinframe>11
- dkcoinframe=1
- endif
- drawimage krook_walk_right(dkcoinframe), 100, 100, 1
- if timer()>frametimer
- dkcoinframe=dkcoinframe+1
- frametimer=timer()+100
- endif
- text 100, 110, "currentframe = "+str$(dkcoinframe)
- function showfacing(object)
- print "The direction for this bee is "
- waitkey
- waitnokey
- endfunction
- sync
- cls rgb(0,0,0)
- goto littleloop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement