I'm afraid I won't be able to complete my entry, since I'm leaving on vacation the day after tomorrow. I thought I would be able to complete it but problems popped up and I've been very busy with exams lately. I will just post my entry, that is not even half completed here, I don't think it's far enough to be counted in the competition but you guys may decide.
There are quite some bugs in it, escpecially the primitive collision detection of the boulders, I'm planning to totally rewright that part, also the boulders dont fall of to the left and right, that's something I will still have to add if I find some time. The AI of fire flys is done but there is no collision detection with them and the player yet. Graphics 100% created with the DrawRect command :P There are 3 colorschemes so far and if I, sometime, am going to create new levels I will probably add more so that every level has it's own colorscheme :)
There are 2 levels that can be quite fun, the 3th one is more a small test for the firefly AI.
So, here's the code:
SuperStrict
'---------------------------------------------
' Global variables
'---------------------------------------------
Const TileW : Int = 32 ' *!* NOTE: IF THIS GETS CHANGED IMAGES WON'T BE RIGHT ANYMORE *!*
Const TileH : Int = 32 ' *!* NOTE: IF THIS GETS CHANGED IMAGES WON'T BE RIGHT ANYMORE *!*
Const PlayerSpeed : Int = 4 ' *!* NOTE: MUST BE DEVIDABLE BY TILE WIDTH AND HEIGHT *!*
Const TotalMaps : Int = 3
Const DIRT : Int = 1
Const SOFTWALL : Int = 2
Const HARDWALL : Int = 3
Const ROCK : Int = 4
Const DIAMOND : Int = 5
Const DOOR : Int = 6
Const FIREFLY : Int = 7
Global Dirt_Img : TImage
Global Boulder_Img : TImage
Global Player_Img : TImage
Global HardWall_Img : TImage
Global SoftWall_Img : TImage
Global Amoeba_Img : TImage
Global Diamond_Img : TImage
Global Door_Img : TImage
Global FireFly_Img : TImage
Global PlayerMoving : Int
Global PlayerDirection : Int
Global PlayerFrame : Int = 2
Global PlayerX : Int
Global PlayerY : Int
Global PlayerMapX : Int
Global PlayerMapY : Int
Global PlayerDiamonds : Int
Global DiamondsNeeded : Int
Global PlayerScore : Int
Global PlayerLives : Int = 3
Global TimeLeft : Int = 2000
Global CurrentFrame : Int
Global LastUpdate : Int ' For animation
Global UpdateTime : Int = 100 ' For animation
Global CurrentMap : Int = 0
Global Maps : TMap[]
Global MapXOffset : Int ' For scrolling
Global MapYOffset : Int ' For scrolling
Global vpx : Float = 0.0 ' Starting X location of viewport
Global vpy : Float = 32.0 ' Starting Y location of viewport
Global Boulder : TBoulder
Global Boulder_List : TList
Global FFly : TFireFly
Global FireFly_List : TList
'---------------------------------------------
' Map type
'---------------------------------------------
Type TMap
Field name : String
Field colorScheme : Int
Field width : Int
Field height : Int
Field map : Int[,]
Field startX : Int
Field startY : Int
Field scrollSpacer : Int
Field time : Int
Field diamondsNeeded : Int
Field diamondValue : Int
Field originalMap : Int[,]
Function Create:TMap()
Local m:TMap = New TMap
m.scrollSpacer = 2
Return m
EndFunction
Method Draw()
Local x:Int, y:Int, newx:Int, newy:Int
' Loop trough the map
For x=0 To width-1
newx = x*TileW - MapXOffset + vpx
For y=0 To height-1
newy = y*TileH - MapYOffset + vpy
' Draw the correct image
If map[x,y] = DIRT Then
DrawImage(Dirt_Img, newx, newy)
ElseIf map[x,y] = SOFTWALL Then
DrawImage(SoftWall_Img, newx, newy)
ElseIf map[x,y] = HARDWALL Then
DrawImage(HardWall_Img, newx, newy)
ElseIf map[x,y] = DIAMOND Then
DrawImage(Diamond_Img, newx, newy, CurrentFrame)
ElseIf map[x,y] = DOOR Then
If PlayerDiamonds >= diamondsNeeded
DrawImage(Door_Img, newx, newy, CurrentFrame)
Else
DrawImage(Door_Img, newx, newy, 0)
EndIf
EndIf
Next
Next
EndMethod
EndType
'---------------------------------------------
' Boulder type
'---------------------------------------------
Type TBoulder
Field x : Float
Field y : Float
Field speed : Int
Field mapX : Int
Field mapY : Int
Field moveing : Int
Field falling : Int
Function Create:TBoulder(xpos:Int, ypos:Int)
Local b:TBoulder = New TBoulder
b.x = xpos * TileW
b.y = ypos * TileH
b.mapX = xpos
b.mapY = ypos
b.speed = 8
ListAddLast(Boulder_List, b)
Return b
EndFunction
Method Fall()
If Maps[CurrentMap].map[mapX,mapY+1] = DIRT Or Maps[CurrentMap].map[mapX,mapY+1] = SOFTWALL Or Maps[CurrentMap].map[mapX,mapY+1] = ROCK Or ..
Maps[CurrentMap].map[mapX,mapY+1] = HARDWALL Or Maps[CurrentMap].map[mapX,mapY+1] = DIAMOND Or (PlayerMapY = mapY+1 And PlayerMapX = mapX) Then
Return
Else
falling = True
y :+ speed
mapY = y/TileH
mapX = x/TileW
Maps[CurrentMap].map[mapX, mapY] = ROCK
If Maps[CurrentMap].map[mapX, mapY-1] = ROCK Then Maps[CurrentMap].map[mapX, mapY-1] = 0
' Check to kill player
If (mapX = PlayerMapX And mapY+1 = PlayerMapY)
Kill_Player("You were crushed by a boulder!")
EndIf
' Check to kill firefly
If Maps[CurrentMap].map[mapX, mapY] = FIREFLY Or Maps[CurrentMap].map[mapX, mapY+1] = FIREFLY
Kill_Player("You crushed a firefly!")
EndIf
EndIf
EndMethod
Method Push:Int(dir:Int)
If falling = False
' Pushing right
If dir = 4 Then
If Maps[CurrentMap].map[mapX+1,mapY] = DIRT Or Maps[CurrentMap].map[mapX+1,mapY] = SOFTWALL Or Maps[CurrentMap].map[mapX+1,mapY] = ROCK Or ..
Maps[CurrentMap].map[mapX+1,mapY] = HARDWALL Or Maps[CurrentMap].map[mapX+1,mapY] = DIAMOND Then
moveing = False
Return False
' Move :)
Else
moveing = True
x :+ PlayerSpeed
mapY = y/TileH
mapX = x/TileW
Maps[CurrentMap].map[mapX, mapY] = ROCK
'If Maps[CurrentMap].map[mapX-1, mapY] = ROCK Then Maps[CurrentMap].map[mapX-1, mapY] = 0
Return True
EndIf
' Pushing left
ElseIf dir = 3 Then
If Maps[CurrentMap].map[mapX-1,mapY] = DIRT Or Maps[CurrentMap].map[mapX-1,mapY] = SOFTWALL Or Maps[CurrentMap].map[mapX-1,mapY] = ROCK Or ..
Maps[CurrentMap].map[mapX-1,mapY] = HARDWALL Or Maps[CurrentMap].map[mapX-1,mapY] = DIAMOND Then
If (x) Mod TileW <> 0
x :- PlayerSpeed
EndIf
moveing = False
Return False
' Move :)
Else
moveing = True
x :- PlayerSpeed
mapY = y/TileH
mapX = x/TileW
Maps[CurrentMap].map[mapX, mapY] = ROCK
'If Maps[CurrentMap].map[mapX+1, mapY] = ROCK Then Maps[CurrentMap].map[mapX+1, mapY] = 0
Return True
EndIf
EndIf
Else
Return False
EndIf
EndMethod
Method Draw()
' Update position
mapX = x/TileW
mapY = y/TileH
' Check if we have to kill player
If mapX = PlayerMapX And mapY = PlayerMapY
Kill_Player("You were crushed by a boulder!")
EndIf
' Check if boulder is one a correct position
If (x) Mod TileW = 0 And (y) Mod TileH = 0
mapX = x/TileW
mapY = y/TileH
If Maps[CurrentMap].map[mapX,mapY+1] = DIRT Or Maps[CurrentMap].map[mapX,mapY+1] = SOFTWALL Or Maps[CurrentMap].map[mapX,mapY+1] = ROCK Or ..
Maps[CurrentMap].map[mapX,mapY+1] = HARDWALL Or Maps[CurrentMap].map[mapX,mapY+1] = DIAMOND Or (PlayerMapY = mapY+1 And PlayerMapX = mapX)
falling = False
Else
falling = True
Fall()
EndIf
ElseIf (y) Mod TileH <> 0
Fall()
ElseIf (x) Mod TileW <> 0
Push(PlayerDirection)
EndIf
DrawImage(Boulder_Img, x-MapXOffset+vpx, y-MapYOffset+vpy)
EndMethod
EndType
'---------------------------------------------
' FireFly type
'---------------------------------------------
Type TFireFly
Field x : Int
Field y : Int
Field speed : Int
Field mapX : Int
Field mapY : Int
Field direction : Int
Field move : Int
Function Create:TFireFly(xpos:Int, ypos:Int)
Local f:TFireFly = New TFireFly
f.x = xpos * TileW
f.y = ypos * TileH
f.mapX = xpos
f.mapY = ypos
f.speed = 4
f.direction = 4
ListAddLast(FireFly_List, f)
Return f
EndFunction
Method Draw()
' Update position
mapX = x/TileW
mapY = y/TileH
Maps[CurrentMap].map[mapX,mapY] = FIREFLY
If Maps[CurrentMap].map[mapX,mapY-1] = FIREFLY Then Maps[CurrentMap].map[mapX,mapY-1] = 0
If Maps[CurrentMap].map[mapX,mapY+1] = FIREFLY Then Maps[CurrentMap].map[mapX,mapY+1] = 0
If Maps[CurrentMap].map[mapX-1,mapY] = FIREFLY Then Maps[CurrentMap].map[mapX-1,mapY] = 0
If Maps[CurrentMap].map[mapX+1,mapY] = FIREFLY Then Maps[CurrentMap].map[mapX+1,mapY] = 0
' Check if we arrived at position
If (x) Mod TileW = 0 And (y) Mod TileH = 0
Select direction
' North
Case 1
' We want to turn left
If Maps[CurrentMap].map[mapX-1,mapY] = 0
direction = 3
move = True
x :- speed
' Now we want to go straight
ElseIf Maps[CurrentMap].map[mapX,mapY-1] = 0
direction = 1
move = True
y :- speed
' Try to go right
ElseIf Maps[CurrentMap].map[mapX+1,mapY] = 0
direction = 4
move = True
x :+ speed
' Just head same way back
Else
direction = 2
move = True
y :+ speed
EndIf
' South
Case 2
' We want to turn right
If Maps[CurrentMap].map[mapX+1,mapY] = 0
direction = 4
move = True
x :+ speed
' Now we want to go straight
ElseIf Maps[CurrentMap].map[mapX,mapY+1] = 0
direction = 2
move = True
y :+ speed
' Try to go left
ElseIf Maps[CurrentMap].map[mapX-1,mapY] = 0
direction = 3
move = True
x :- speed
' Head same way back
Else
direction = 1
move = True
y :- speed
EndIf
' West
Case 3
' We want to move down
If Maps[CurrentMap].map[mapX,mapY+1] = 0
direction = 2
move = True
y :+ speed
' Go straight
ElseIf Maps[CurrentMap].map[mapX-1,mapY] = 0
direction = 3
move = True
x :- speed
' Try up
ElseIf Maps[CurrentMap].map[mapX,mapY-1] = 0
direction = 1
move = True
y :- speed
' Same way back
Else
direction = 4
move = True
x :+ speed
EndIf
' East
Case 4
' Priority to up
If Maps[CurrentMap].map[mapX,mapY-1] = 0
direction = 1
move = True
y :- speed
' Straight
ElseIf Maps[CurrentMap].map[mapX+1,mapY] = 0
direction = 4
move = True
x :+ speed
' Try down
ElseIf Maps[CurrentMap].map[mapX,mapY+1] = 0
direction = 2
move = True
y :+ speed
' Same way back
Else
direction = 3
move = True
x :- speed
EndIf
EndSelect
Else
Select direction
' North
Case 1
direction = 1
move = True
y :- speed
' South
Case 2
direction = 2
move = True
y :+ speed
' West
Case 3
direction = 3
move = True
x :- speed
' East
Case 4
direction = 4
move = True
x :+ speed
EndSelect
EndIf
DrawImage(FireFly_Img, x-MapXOffset+vpx, y-MapYOffset+vpy, CurrentFrame)
EndMethod
EndType
'---------------------------------------------
' Setup the graphics
'---------------------------------------------
Graphics 800, 600
AppTitle = "Bouldermax"
SeedRnd(MilliSecs())
Boulder_List = CreateList()
FireFly_List = CreateList()
'---------------------------------------------
' Start
'---------------------------------------------
Load_Maps()
Load_Boulders()
Create_Images(Maps[CurrentMap].colorScheme)
MapXOffset = 0
MapYOffset = 0
PlayerX = Maps[CurrentMap].startX*TileW + vpx
PlayerY = Maps[CurrentMap].startY*TileH + vpy
Maps[CurrentMap].time = Maps[CurrentMap].time*1000 + MilliSecs()
'---------------------------------------------
' Main loop
'---------------------------------------------
Repeat
'********************
' Update
'********************
Handle_Input()
If PlayerLives =< 0 Then Notify "Game Over" ; End
If MilliSecs() >= LastUpdate + UpdateTime
LastUpdate = MilliSecs() + UpdateTime
If CurrentFrame = 0
CurrentFrame = 1
ElseIf CurrentFrame = 1
CurrentFrame = 0
EndIf
EndIf
If TimeLeft <= 0
Notify "You ran out of time!"
End
EndIf
'********************
' Draw
'********************
Maps[CurrentMap].Draw()
DrawImage(Player_Img, PlayerX, PlayerY, PlayerFrame)
Draw_Boulders()
'********************
' GUI
'********************
SetColor 0, 0, 0
DrawRect(0, 0, GraphicsWidth(), vpy)
DrawRect(0, 0, vpx, GraphicsHeight())
SetColor 255, 255, 255
DrawText "Diamonds: " + PlayerDiamonds + "/" + Maps[CurrentMap].DiamondsNeeded, 10, 10
DrawText "Lives: " + PlayerLives, 180, 10
TimeLeft = (Maps[CurrentMap].time/1000)-(MilliSecs()/1000)
DrawText "Time: " + TimeLeft, 360, 10
DrawText "Score: " + PlayerScore, 540, 10
'********************
' Update screen
'********************
Flip
Cls
Until KeyHit(KEY_ESCAPE)
'------------------------------------------------------
' Function: Handle_Input()
'------------------------------------------------------
Function Handle_Input()
Maps[CurrentMap].map[PlayerMapX, PlayerMapY] = 0
' Check if we have arrived at a correct horizontal position
If (PlayerX+MapXOffset) Mod TileW = 0 And (PlayerY+MapYOffset) Mod TileH = 0
PlayerMoving = False
' Update cords
PlayerMapX = (PlayerX+MapXOffset-vpx)/TileW
PlayerMapY = (PlayerY+MapYOffset-vpy)/TileH
' Check position
If Maps[CurrentMap].map[PlayerMapX, PlayerMapY] = DIRT Then
Maps[CurrentMap].map[PlayerMapX, PlayerMapY] = 0
ElseIf Maps[CurrentMap].map[PlayerMapX, PlayerMapY] = DIAMOND Then
Maps[CurrentMap].map[PlayerMapX, PlayerMapY] = 0
PlayerDiamonds :+ 1
PlayerScore :+ Maps[CurrentMap].diamondValue
ElseIf Maps[CurrentMap].map[PlayerMapX, PlayerMapY] = DOOR And PlayerDiamonds >= Maps[CurrentMap].diamondsNeeded Then
Notify "Level Completed!"
CurrentMap :+ 1
Load_Boulders()
Create_Images(Maps[CurrentMap].colorScheme)
MapXOffset = 0
MapYOffset = 0
PlayerX = Maps[CurrentMap].startX*TileW + vpx
PlayerY = Maps[CurrentMap].startY*TileH + vpy
PlayerMapX = (PlayerX+MapXOffset-vpx)/TileW
PlayerMapY = (PlayerY+MapYOffset-vpy)/TileH
PlayerDiamonds = 0
PlayerScore :+ TimeLeft
Maps[CurrentMap].time = Maps[CurrentMap].time*1000 + MilliSecs()
EndIf
Else
PlayerMoving = True
' If we are moving left
If PlayerDirection = 3
Move_Player(3)
' For moving right
ElseIf PlayerDirection = 4
Move_Player(4)
' For moving up
ElseIf PlayerDirection = 1
Move_Player(1)
' For moving down
ElseIf PlayerDirection = 2
Move_Player(2)
EndIf
EndIf
' Check if we are not moving
If PlayerMoving = False
' Movement with arrows
If KeyDown(KEY_UP)
Move_Player(1)
ElseIf KeyDown(KEY_DOWN)
Move_Player(2)
ElseIf KeyDown(KEY_LEFT)
Move_Player(3)
ElseIf KeyDown(KEY_RIGHT)
Move_Player(4)
EndIf
EndIf
EndFunction
'------------------------------------------------------
' Fuction: Move_Player(...)
' Purpose: Makes the player move one square
' Arguments: Dir: The direction to move the player
'------------------------------------------------------
Function Move_Player(Dir:Int)
' Check direction
Select Dir
' Move up
Case 1
' Check collision
If Maps[CurrentMap].map[PlayerMapX, PlayerMapY-1] = HARDWALL Or Maps[CurrentMap].map[PlayerMapX, PlayerMapY-1] = SOFTWALL Or ..
Maps[CurrentMap].map[PlayerMapX, PlayerMapY-1] = ROCK Then
PlayerMoving = False
' Move
Else
PlayerMoving = True
PlayerDirection = 1
' Check if we are in the middle of the screen
If PlayerY =< GraphicsHeight()/2 - Maps[CurrentMap].scrollSpacer*TileH Then
' Check if the map is not at it's edge
If MapYOffset > 0
MapYOffset :- PlayerSpeed
Else
PlayerY :- PlayerSpeed
EndIf
Else
PlayerY :- PlayerSpeed
EndIf
EndIf
' Move down
Case 2
' Check collision
If Maps[CurrentMap].map[PlayerMapX, PlayerMapY+1] = HARDWALL Or Maps[CurrentMap].map[PlayerMapX, PlayerMapY+1] = SOFTWALL Or ..
Maps[CurrentMap].map[PlayerMapX, PlayerMapY+1] = ROCK Then
PlayerMoving = False
Else
PlayerMoving = True
PlayerDirection = 2
' Check if we are in the middle of the screen
If PlayerY >= GraphicsHeight()/2 + Maps[CurrentMap].scrollSpacer*TileH Then
' Check if the map is not at it's edge
If MapYOffset < Maps[CurrentMap].height*TileH Then
MapYOffset :+ PlayerSpeed
Else
PlayerY :+ PlayerSpeed
EndIf
Else
PlayerY :+ PlayerSpeed
EndIf
PlayerFrame = 2
EndIf
' Move left
Case 3
' Check collision
If Maps[CurrentMap].map[PlayerMapX-1, PlayerMapY] = HARDWALL Or Maps[CurrentMap].map[PlayerMapX-1, PlayerMapY] = SOFTWALL Then
PlayerMoving = False
' Can we push a rock?
ElseIf Maps[CurrentMap].map[PlayerMapX-1, PlayerMapY] = ROCK And (PlayerX+MapXOffset) Mod TileW = 0 Then
' Select the correct boulder
For Boulder = EachIn(Boulder_List)
If Boulder.mapX = PlayerMapX - 1 And Boulder.mapY = PlayerMapY Then
' If we can push him
If Boulder.Push(3) = True Then
' Just move the player, boulder will join in
PlayerMoving = True
PlayerDirection = 3
' Check if we are in the middle of the screen
If PlayerX =< GraphicsWidth()/2 - Maps[CurrentMap].scrollSpacer*TileW Then
' Check if the map is not at it's edge
If MapXOffset > 0 Then
MapXOffset :- PlayerSpeed
Else
PlayerX :- PlayerSpeed
EndIf
Else
PlayerX :- PlayerSpeed
EndIf
PlayerFrame = 0
Else
PlayerMoving = False
EndIf
EndIf
Next
Else
PlayerMoving = True
PlayerDirection = 3
' Check if we are in the middle of the screen
If PlayerX =< GraphicsWidth()/2 - Maps[CurrentMap].scrollSpacer*TileW Then
' Check if the map is not at it's edge
If MapXOffset > 0 Then
MapXOffset :- PlayerSpeed
Else
PlayerX :- PlayerSpeed
EndIf
Else
PlayerX :- PlayerSpeed
EndIf
PlayerFrame = 0
EndIf
' Move right
Case 4
' Check collision
If Maps[CurrentMap].map[PlayerMapX+1, PlayerMapY] = HARDWALL Or Maps[CurrentMap].map[PlayerMapX+1, PlayerMapY] = SOFTWALL Then
PlayerMoving = False
' Can we push a rock?
ElseIf Maps[CurrentMap].map[PlayerMapX+1, PlayerMapY] = ROCK And (PlayerX+MapXOffset) Mod TileW = 0 Then
' Select the correct boulder
For Boulder = EachIn(Boulder_List)
If Boulder.mapX = PlayerMapX + 1 And Boulder.mapY = PlayerMapY Then
' If we can push him
If Boulder.Push(4) = True Then
' Just move the player, boulder will join in
PlayerMoving = True
PlayerDirection = 4
' Check if we are in the middle of the screen
If PlayerX >= GraphicsWidth()/2 + Maps[CurrentMap].scrollSpacer*TileW Then
' Check if the map is not at it's edge
If MapXOffset < Maps[CurrentMap].width*TileW Then
MapXOffset :+ PlayerSpeed
Else
PlayerX :+ PlayerSpeed
EndIf
Else
PlayerX :+ PlayerSpeed
EndIf
PlayerFrame = 1
Else
PlayerMoving = False
EndIf
EndIf
Next
Else
PlayerMoving = True
PlayerDirection = 4
' Check if we are in the middle of the screen
If PlayerX >= GraphicsWidth()/2 + Maps[CurrentMap].scrollSpacer*TileW Then
' Check if the map is not at it's edge
If MapXOffset < Maps[CurrentMap].width*TileW Then
MapXOffset :+ PlayerSpeed
Else
PlayerX :+ PlayerSpeed
EndIf
Else
PlayerX :+ PlayerSpeed
EndIf
PlayerFrame = 1
EndIf
EndSelect
EndFunction
'------------------------------------------------------
' Fuction: Kill_Player()
' Purpose: Kills the player
' Arguments: Reason$: Message to print to the player
'------------------------------------------------------
Function Kill_Player(reason:String)
PlayerLives :- 1
ClearList(Boulder_List)
ClearList(FireFly_List)
Notify reason
PlayerDiamonds = 0
If PlayerLives > 0
PlayerX = Maps[CurrentMap].startX*TileW + vpx
PlayerY = Maps[CurrentMap].startY*TileH + vpy
MapXOffset = 0
MapYOffset = 0
For Local x:Int=0 To Maps[CurrentMap].width-1
For Local y:Int=0 To Maps[CurrentMap].height-1
Maps[CurrentMap].map[x,y] = Maps[CurrentMap].originalMap[x,y]
' Create boulders
If Maps[CurrentMap].map[x,y] = ROCK Then
Boulder = TBoulder.Create(x, y)
EndIf
' Create fireflys
If Maps[CurrentMap].map[x,y] = FIREFLY Then
FFly = TFireFly.Create(x, y)
EndIf
Next
Next
Else
Notify "Game Over" ; End
EndIf
EndFunction
'------------------------------------------------------
' Fuction: Draw_Boulders()
' Purpose: Draw and update all boulders
'------------------------------------------------------
Function Draw_Boulders()
Local x:Int, y:Int
' Loop trough all boulders
For Boulder = EachIn(Boulder_List)
Boulder.Draw()
Next
' Loop trough fireflys
For FFly = EachIn(FireFly_List)
FFly.Draw()
Next
EndFunction
'------------------------------------------------------
' Fuction: Load_Boulders()
' Purpose: Loads in the boulders
'------------------------------------------------------
Function Load_Boulders()
ClearList(Boulder_List)
For Local x:Int = 0 To Maps[CurrentMap].width-1
For Local y:Int = 0 To Maps[CurrentMap].height-1
' Create boulders
If Maps[CurrentMap].map[x,y] = ROCK Then
Boulder = TBoulder.Create(x, y)
' Create fireflys
ElseIf Maps[CurrentMap].map[x,y] = FIREFLY Then
FFly = TFireFly.Create(x, y)
EndIf
Next
Next
EndFunction
'------------------------------------------------------
' Fuction: Load_Map()
' Purpose: Loads in a defdata defined map
'------------------------------------------------------
Function Load_Maps()
Local title:String, x:Int, y:Int, i:Int
' Create map packet
Maps = New TMap[TotalMaps]
For i=0 To TotalMaps-1
' Create
Maps[i] = TMap.Create()
' Read the map title and check
ReadData Maps[i].name
' Load in the rest of the map data
ReadData Maps[i].width
ReadData Maps[i].height
ReadData Maps[i].diamondsNeeded
ReadData Maps[i].time
ReadData Maps[i].colorScheme
ReadData Maps[i].startX
ReadData Maps[i].startY
ReadData Maps[i].diamondValue
Maps[i].map = New Int[Maps[i].width, Maps[i].height]
Maps[i].originalMap = New Int[Maps[i].width, Maps[i].height]
' Load tiles
For y=0 To Maps[i].height-1
For x=0 To Maps[i].width-1
ReadData Maps[i].map[x,y]
Maps[i].originalMap[x,y] = Maps[i].map[x,y]
Next
Next
Next
EndFunction
'------------------------------------------------------
' Fuction: Create_Images(...)
' Purpose: Creates the tile images
' Arguments: ColorScheme: The colorscheme to use
' Comments: ColorScheme:
' 1=Classic: Brownish
' 2= Nature: Greenish-Pinkish
' 3=Fiction: Purpleish-Pinkish
'------------------------------------------------------
Function Create_Images(Colorscheme:Int)
Local mainR:Int, mainG:Int, mainB:Int
Local dirtR:Int, dirtG:Int, dirtB:Int
Local glanceR:Int, glanceG:Int, glanceB:Int
' Setup the right colorscheme
Select Colorscheme
Case 1
mainR = 100 ; mainG = 100 ; mainB = 100
dirtR = 163 ; dirtG = 110 ; dirtB = 48
glanceR = 255 ; glanceG = 255 ; glanceB = 255
Case 2
mainR = 222 ; mainG = 155 ; mainB = 146
dirtR = 130 ; dirtG = 110 ; dirtB = 11
glanceR = 137 ; glanceG = 198 ; glanceB = 101
Case 3
mainR = 157 ; mainG = 84 ; mainB = 196
dirtR = 210 ; dirtG = 136 ; dirtB = 126
glanceR = 255 ; glanceG = 255 ; glanceB = 255
EndSelect
HardWall_Img = Null
SoftWall_Img = Null
Player_Img = Null
Amoeba_Img = Null
Door_Img = Null
Boulder_Img = Null
Dirt_Img = Null
Diamond_Img = Null
' --> Hard wall
' Base
SetColor mainR, mainG, mainB
DrawRect(0, 0, TileW, TileH)
' Black shadows
SetColor 0, 0, 0
DrawRect(4, 6, 8, 2) ; DrawRect(8, 8, 4, 4) ; DrawRect(TileW-12, 6, 8, 2) ; DrawRect(TileW-8, 8, 4, 4)
DrawRect(4, TileH-12, 8, 2) ; DrawRect(8, TileH-10, 4, 4) ; DrawRect(TileW-12, TileH-12, 8, 2) ; DrawRect(TileW-8, TileH-10, 4, 4)
' White glance
SetColor 255, 255, 255
DrawRect(4, 10, 4, 2) ; DrawRect(TileW-12, 10, 4, 2) ; DrawRect(4, TileH-8, 4, 2) ; DrawRect(TileW-12, TileH-8, 4, 2)
' Update image
SetColor 255, 255, 255
If Not HardWall_Img Then HardWall_Img = TImage.Create(TileW, TileH, 1, 0, 0, 0, 0)
HardWall_Img.pixmaps[0] = GrabPixmap(0, 0, TileW, TileH)
Cls
' --> Soft wall
' Base
SetColor 0, 0, 0
DrawRect(0, 0, TileW, TileH)
' Briks of scheme's main color
SetColor mainR, mainG, mainB
DrawRect(4, 2, 4, 4) ; DrawRect(8, 4, 8, 2) ; DrawRect(20, 2, 4, 4) ; DrawRect(24, 4, 8, 2)
DrawRect(0, 12, 8, 2) ; DrawRect(12, 10, 4, 4) ; DrawRect(16, 12, 8, 2) ; DrawRect(28, 10, 4, 4)
DrawRect(4, 18, 4, 4) ; DrawRect(8, 20, 8, 2) ; DrawRect(20, 18, 4, 4) ; DrawRect(24, 20, 8, 2)
DrawRect(0, 28, 8, 2) ; DrawRect(12, 26, 4, 4) ; DrawRect(16, 28, 8, 2) ; DrawRect(28, 26, 4, 4)
' White glance
SetColor 255, 255, 255
DrawRect(4, 0, 12, 2) ; DrawRect(8, 2, 8, 2) ; DrawRect(20, 0, 12, 2) ; DrawRect(24, 2, 8, 2)
DrawRect(0, 8, 8, 4) ; DrawRect(12, 8, 12, 2) ; DrawRect(16, 10, 8, 2) ; DrawRect(28, 8, 4, 2)
DrawRect(4, 16, 12, 2) ; DrawRect(8, 18, 8, 2) ; DrawRect(20, 16, 12, 2) ; DrawRect(24, 18, 8, 2)
DrawRect(0, 24, 8, 4) ; DrawRect(12, 24, 12, 2) ; DrawRect(16, 26, 8, 2) ; DrawRect(28, 24, 4, 2)
' Update iamge
SetColor 255, 255, 255
If Not SoftWall_Img Then SoftWall_Img = TImage.Create(TileW, TileH, 1, 0, 0, 0, 0)
SoftWall_Img.pixmaps[0] = GrabPixmap(0, 0, TileW, TileH)
Cls
' --> Diamond
' Base
SetColor 0, 0, 0
DrawRect(0, 0, TileW, TileH)
' Stripes of main color
SetColor mainR, mainG, mainB
DrawRect(12, 0, 4, 2) ; DrawRect(12, 2, 8, 2) ; DrawRect(8, 4, 12, 2) ; DrawRect(24, 10, 4, 2) ; DrawRect(20, 6, 4, 2)
DrawRect(0, 12, 4, 2) ; DrawRect(4, 8, 4, 2) ; DrawRect(4, 14, 28, 2) ; DrawRect(28, 18, 4, 2) ; DrawRect(0, 16, 4, 2)
DrawRect(4, 20, 20, 2) ; DrawRect(8, TileH-8, 4, 2) ; DrawRect(24, 22, 4, 2) ; DrawRect(20, TileH-6, 4, 2) ; DrawRect(16, TileH-4, 4, 2)
' Stripes of dirt
SetColor dirtR, dirtG, dirtB
DrawRect(12, 2, 4, 2) ; DrawRect(8, 6, 12, 2) ; DrawRect(4, 12, 24, 2) ; DrawRect(0, 14, 4, 2) ; DrawRect(0, 18, 4, 2)
DrawRect(4, 10, 4, 2) ; DrawRect(4, 22, 20, 2) ; DrawRect(12, TileH-2, 8, 2) ; DrawRect(12, TileH-4, 4, 2) ; DrawRect(8, TileH-6, 4, 2)
' White glance
SetColor 255, 255, 255
DrawRect(4, 16, 28, 2) ; DrawRect(4, 18, 24, 2) ; DrawRect(24, 20, 4, 2) ; DrawRect(20, TileH-8, 4, 2)
' Update image
SetColor 255, 255, 255
If Not Diamond_Img Then Diamond_Img = TImage.Create(TileW, TileH, 2, 0, 0, 0, 0)
Diamond_Img.pixmaps[0] = GrabPixmap(0, 0, TileW, TileH)
Cls
' --> Diamond second frame
' Base
DrawImage(Diamond_Img, 0, 0, 0)
' Ajust the glance a lil
SetColor 255, 255, 255
DrawRect(8, 8, 16, 2) ; DrawRect(12, 6, 8, 2) ; DrawRect(12, 24, 12, 2) ; DrawRect(12, 26, 8, 2)
' Add some black shadow anim updatezorz
SetColor 0, 0, 0
DrawRect(4, 16, 28, 2) ; DrawRect(24, 20, 4, 2)
' Update image
SetColor 255, 255, 255
Diamond_Img.pixmaps[1] = GrabPixmap(0, 0, TileW, TileH)
Cls
' --> Amoeba
' Base
SetColor 141, 204, 104
DrawRect(0, 0, TileW, TileH)
' Pink border
SetColor 222, 155, 146
DrawRect(TileW/2-10, 0, 4, 2) ; DrawRect(TileW/2-6, 2, 4, 2) ; DrawRect(TileW/2-2, 4, 4, 2) ; DrawRect(TileW/2+2, 2, 4, 2) ; DrawRect(TileW/2+6, 0, 4, 2)
DrawRect(0, TileH/3, 4, 2)
DrawRect(TileW-8, TileH/3, 4, 2) ; DrawRect(TileW-4, TileH/3-2, 4, 2) ; DrawRect(TileW-4, TileH/3+2, 4, 2)
DrawRect(TileW/2-10, TileH-2, 4, 2) ; DrawRect(TileW/2-6, TileH-4, 4, 2) ; DrawRect(TileW/2-2, TileH-6, 4, 2) ; DrawRect(TileW/2+2, TileH-4, 4, 2) ; DrawRect(TileW/2+6, TileH-2, 4, 2)
' Dark grey filling
SetColor 0, 0, 0
DrawRect(TileW/2-6, 0, 12, 2);DrawRect(TileW/2-2, 2, 4, 2)
DrawRect(TileW-4, TileH/3, 4, 2)
DrawRect(TileW/2-6, TileH-2, 12, 2);DrawRect(TileW/2-2, TileH-4, 4, 2)
' Update image
SetColor 255, 255, 255
If Not Amoeba_Img Then Amoeba_Img = TImage.Create(TileW, TileH, 1, 0, 0, 0, 0)
Amoeba_Img.pixmaps[0] = GrabPixmap(0, 0, TileW, TileH)
Cls
' --> Boulder
' Base
SetColor mainR, mainG, mainB
DrawRect(0, 0, TileW, TileH)
' Shine
SetColor glanceR, glanceG, glanceB
DrawRect(0, 4, 4, 2) ; DrawRect(4, 2, 4, 2) ; DrawRect(8, 0, 12, 2) ; DrawRect(12, 2, 12, 2) ; DrawRect(20, 4, 8, 6)
DrawRect(28, 6, 4, 10) ; DrawRect(24, 12, 4, 2) ; DrawRect(16, 4, 4, 2)
' Bit of dirt on it
SetColor dirtR, dirtG, dirtB
DrawRect(TileW-4, TileH/2, 4, 4) ; DrawRect(TileW-12, 10, 4, 2) ; DrawRect(TileW-12, 14, 4, 2) ; DrawRect(8, 12, 8, 2)
DrawRect(4, 4, 4, 2) ; DrawRect(8, 6, 4, 2) ; DrawRect(12, 8, 4, 2) ; DrawRect(16, 6, 4, 2)
DrawRect(TileW-12, TileH/2+2, 4, 2) ; DrawRect(TileW/2, TileH-4, 4, 2) ; DrawRect(4, 10, 4, 2)
' Black shadows
SetColor 0, 0, 0
DrawRect(TileW/2-4, TileH-4, 4, 2) ; DrawRect(12, TileH-8, 4, 2) ; DrawRect(8, TileH-10, 4, 2) ; DrawRect(4, TileH-12, 4, 2)
DrawRect(8, 18, 4, 2) ; DrawRect(4, 16, 4, 2)
' Black to make it round
SetColor 0, 0, 0
DrawRect(0, 0, 8, 2) ; DrawRect(0, 2, 4, 2) ; DrawRect(TileW-12, 0, 12, 2) ; DrawRect(TileW-8, 2, 8, 2)
DrawRect(0, TileH-2, 12, 2) ; DrawRect(0, TileH-4, 8, 2) ; DrawRect(0, TileH-6, 4, 2) ; DrawRect(TileW-12, TileH-2, 12, 2)
DrawRect(TileW-8, TileH-4, 8, 2) ; DrawRect(TileW-4, TileH-8, 4, 8) ; DrawRect(TileW-4, 4, 4, 2)
' Update image
SetColor 255, 255, 255
If Not Boulder_Img Then Boulder_Img = TImage.Create(TileW, TileH, 1, 0, 0, 0, 0)
Boulder_Img.pixmaps[0] = GrabPixmap(0, 0, TileW, TileH)
Cls
' --> Player sides
' Head of main color
SetColor mainR, mainG, mainB
DrawRect(TileW-30+ 4, TileH-28+ 2, 16, 8) ; DrawRect(TileW-30+ 0, TileH-28+ 4, 4, 4) ; DrawRect(TileW-30+ 8, TileH-28+ 0, 8, 12)
' Body
DrawRect(TileW-30+ 8, TileH-28+ 12, 8, 16)
' Cloths
SetColor glanceR, glanceG, glanceB
DrawRect(TileW-30+ 8, TileH-28+ 12, 8, 2) ; DrawRect(TileW-30+ 8, TileH-28+ 16, 8, 2) ; DrawRect(TileW-30+ 8, TileH-28+ 20, 8, 2) ; DrawRect(TileW-30+ 4, TileH-28+ 14, 4, 2)
' Legs, dirty ;)
SetColor dirtR, dirtG, dirtB ; DrawRect(TileW-30+ 4, TileH-28+ 22, 12, 4)
' Eye: black
SetColor 0, 0, 0 ; DrawRect(TileW-30+ 4, TileH-28+ 4, 4, 4)
' Update image
SetColor 255, 255, 255
If Not Player_Img Then Player_Img = TImage.Create(TileW, TileH, 3, 0, 0, 0, 0)
Player_Img.pixmaps[0] = GrabPixmap(0, 0, TileW, TileH)
Player_Img.pixmaps[1] = XFlipPixmap(Player_Img.pixmaps[0])
Cls
' --> Player front
' Head: main color
SetColor mainR, mainG, mainB
DrawRect(8, 2, 4, 10) ; DrawRect(20, 2, 4, 10) ; DrawRect(4, 6, 24, 4) ; DrawRect(12, 4, 8, 20)
' Arms & body: main color
DrawRect(8, 14, 16, 2) ; DrawRect(4, 16, 4, 2) ; DrawRect(24, 16, 4, 2)
' Dirty pants :P
SetColor dirtR, dirtG, dirtB
DrawRect(8, 24, 4, 10) ; DrawRect(20, 24, 4, 10)
' Glancy shirt & shoes
SetColor glanceR, glanceG, glanceB
DrawRect(12, 16, 8, 2) ; DrawRect(12, 20, 8, 2) ; DrawRect(12, 24, 8, 2) ; DrawRect(4, 18, 4, 2) ; DrawRect(24, 18, 4, 2)
DrawRect(4, 30, 8, 2) ; DrawRect(20, 30, 8, 2)
' Black eyes
SetColor 0, 0, 0
DrawRect(8, 6, 4, 4) ; DrawRect(20, 6, 4, 4)
' Update image
SetColor 255, 255, 255
Player_Img.pixmaps[2] = GrabPixmap(0, 0, TileW, TileH)
Cls
' --> Dirt
' Base
SetColor dirtR, dirtG, dirtB
DrawRect(0, 0, TileW, TileH)
' Black to make detail
SetColor 0, 0, 0
DrawRect(0, 0, 8, 2) ; DrawRect(8, 2, 4, 2) ; DrawRect(14, 0, 4, 2) ; DrawRect(14, 2, 4, 2)
DrawRect(TileW-8, 0, 4, 4) ; DrawRect(TileW-12, 2, 4, 2) ; DrawRect(0, 4, 4, 2) ; DrawRect(TileW-4, 4, 4, 2)
DrawRect(TileW-4, 10, 4, 2) ; DrawRect(TileW-4, 14, 4, 2) ; DrawRect(TileW-4, 18, 4, 2) ; DrawRect(TileW-4, 26, 4, 2)
DrawRect(TileW-4, 30, 4, 2) ; DrawRect(TileW-8, 28, 4, 4) ; DrawRect(TileW-12, TileH-2, 4, 2) ; DrawRect(6, TileH-2, 6, 2)
DrawRect(0, TileH-8, 4, 2) ; DrawRect(0, TileH/3+4, 4, 2) ; DrawRect(0, TileH/3+8, 4, 2)
' Contast with primary color
SetColor mainR, mainG, mainB
DrawRect(8, 4, 4, 2) ; DrawRect(TileW-8, 4, 4, 2)
DrawRect(0, TileH/3+2, 4, 2) ; DrawRect(4, TileH/3, 4, 2)
DrawRect(10, TileH/3+2, 8, 2) ; DrawRect(18, TileH/3, 4, 2) ; DrawRect(TileW-16, TileH/3+10, 4, 2) ; DrawRect(TileW-16, TileH/3+14, 4, 2)
DrawRect(TileW-8, TileH/3+4, 4, 2) ; DrawRect(TileW-8, TileH/3+12, 4, 2) ; DrawRect(TileW-8, TileH/3+16, 4, 2)
DrawRect(4, TileH/2+4, 4, 8) ; DrawRect(TileH-6, TileW+12, 4, 2)
' Black grey shadows
SetColor 0, 0, 0
DrawRect(8, 6, 4, 2) ; DrawRect(TileW-8, 6, 4, 2) ; DrawRect(10, TileH/3, 4, 2) ; DrawRect(24, TileH/3-4, 4, 2)
DrawRect(4, TileH/3-2, 4, 2) ; DrawRect(4, TileH/3+4, 4, 2) ; DrawRect(20, TileH/3+2, 4, 2) ; DrawRect(20, TileH/3-2, 4, 2)
DrawRect(8, TileH/2+4, 4, 2) ; DrawRect(12, TileH/2+6, 4, 2) ; DrawRect(16, TileH/2+8, 4, 2) ; DrawRect(20, TileH/2+10, 4, 2)
DrawRect(4, TileH/2+12, 4, 2) ; DrawRect(8, TileH/2+14, 8, 1) ; DrawRect(12, TileH/2+12, 4, 2)
' Update image
SetColor 255, 255, 255
If Not Dirt_Img Then Dirt_Img = TImage.Create(TileW, TileH, 1, 0, 0, 0, 0)
Dirt_Img.pixmaps[0] = GrabPixmap(0, 0, TileW, TileH)
Cls
' --> Door (2 framed animation)
' Base closed
SetColor 0, 0, 0
DrawRect(0, 0, TileW, TileH)
' Borders
SetColor mainR, mainG, mainB
DrawRect(0, 0, 32, 4) ; DrawRect(0, 0, 4, 32) ; DrawRect(0, 28, 32, 4) ; DrawRect(28, 0, 4, 32)
' Update 1st frame
SetColor 255, 255, 255
If Not Door_Img Then Door_Img = TImage.Create(TileW, TileH, 2, 0, 0, 0, 0)
Door_Img.pixmaps[0] = GrabPixmap(0, 0, TileW, TileH)
Cls
' Base open = titanium wall
DrawImage(HardWall_Img, 0, 0)
' Borders
SetColor mainR, mainG, mainB
DrawRect(0, 0, 32, 4) ; DrawRect(0, 0, 4, 32) ; DrawRect(0, 28, 32, 4) ; DrawRect(28, 0, 4, 32)
' Update 1st frame
SetColor 255, 255, 255
Door_Img.pixmaps[1] = GrabPixmap(0, 0, TileW, TileH)
Cls
' --> Fire Fly (2 framed animation)
' Base: black
SetColor 0, 0, 0
DrawRect(TileW, TileH, 0, 0)
' White border
SetColor 255, 255, 255
DrawRect(0, 0, 32, 4) ; DrawRect(0, 0, 4, 32) ; DrawRect(28, 0, 4, 32) ; DrawRect(0, 28, 32, 4)
' Main filling
SetColor mainR, mainG, mainB
DrawRect(4, 4, 24, 4) ; DrawRect(4, 4, 4, 24) ; DrawRect(24, 4, 4, 24) ; DrawRect(4, 24, 24, 4) ; DrawRect(12, 12, 8, 8)
' Update 1st frame
SetColor 255, 255, 255
If Not FireFly_Img Then FireFly_Img = TImage.Create(TileW, TileH, 2, 0, 0, 0, 0)
FireFly_Img.pixmaps[0] = GrabPixmap(0, 0, TileW, TileH)
Cls
' Second frame switches black and main color:)
' Base, old image
DrawImage(FireFly_Img, 0, 0)
' Swap main color one ring up !*! test: also swapping outer and innder border
SetColor mainR, mainG, mainB
DrawRect(8, 8, 16, 4) ; DrawRect(8, 8, 4, 16) ; DrawRect(20, 8, 4, 16) ; DrawRect(8, 20, 16, 4)
DrawRect(0, 0, 32, 4) ; DrawRect(0, 0, 4, 32) ; DrawRect(28, 0, 4, 32) ; DrawRect(0, 28, 32, 4)
' Draw black on purples old place !*! test: also swapping outer and innder border
SetColor 0, 0, 0
DrawRect(4, 4, 24, 4) ; DrawRect(4, 4, 4, 24) ; DrawRect(24, 4, 4, 24) ; DrawRect(4, 24, 24, 4) ; DrawRect(12, 12, 8, 8)
' Update 2nd frame
SetColor 255, 255, 255
FireFly_Img.pixmaps[1] = GrabPixmap(0, 0, TileW, TileH)
Cls
EndFunction
'##############################
' Maps
' 0 = Black
' 1 = Sand
' 2 = Softwall
' 3 = HardWall
' 4 = Boulder
' 5 = Diamond
' 6 = Door
' 7 = FireFly
'##############################
' Title Width Height Needed diamonds Time (seconds) Colorscheme Start X Start Y Diamond Value
DefData "Intro", 40, 22, 12, 150, 1, 3, 2, 10
DefData 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
DefData 3, 1, 1, 1, 1, 1, 1, 0, 1, 1, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 4, 1, 1, 1, 1, 1, 1, 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