Skip to content

Commit

Permalink
GameOff Release
Browse files Browse the repository at this point in the history
  • Loading branch information
robjanes committed Dec 1, 2017
1 parent 1c661f7 commit dde4d81
Show file tree
Hide file tree
Showing 9 changed files with 143 additions and 16 deletions.
2 changes: 1 addition & 1 deletion DopeWars.agk
Expand Up @@ -43,7 +43,7 @@ output_path=C:\\Users\\robja\\Dropbox\\Rob Rich Game Development\\DopeWars\\HTML
FILE_0=main.agc;-1

[files]
FILE_NAME_0=1;main.agc;11648;0
FILE_NAME_0=1;main.agc;84471;0

[project]
description=
149 changes: 136 additions & 13 deletions main.agc
Expand Up @@ -590,6 +590,15 @@ global ViewBackgroundSleep as Integer
global SleepAlpha as Integer
global SleepDirection as integer

//Tutorial popup
global ImageTutorial as integer
global ViewTutorial as integer
global LabelTutorial as Integer
global TutorialX as Integer
Global TutorialY as Integer

global LabelDays as Integer

//Creating Falling Items
function CreateFallingItems()
for i = 1 to 100
Expand Down Expand Up @@ -773,7 +782,7 @@ function LoadImages()
IntroVideo = LoadVideo("Title_Video.mp4")
ImageBusted = LoadImage("BustedTitle.png")
ImageBackgroundSleep = LoadImage("Sleep.png")

ImageTutorial = LoadImage("TutorialRight.png")
endfunction

//Start the Moving Animation
Expand Down Expand Up @@ -1094,6 +1103,26 @@ function CreateLabels()
SetTextMaxWidth(LabelBusted,600)
SetTextVisible(LabelBusted,0)
SetTextColor(LabelBusted,255,255,255,255)

//Create the Days Label
LabelDays = CreateText("Day: ")
SetTextFont(LabelDays,GameFont)
SetTextAlignment(LabelDays,1)
SetTextPosition(LabelDays,60,100)
SetTextSize(LabelDays,28)
SetTextMaxWidth(LabelDays,600)
SetTextVisible(LabelDays,0)
SetTextColor(LabelDays,255,255,255,255)

//Create the Days Label
LabelTutorial = CreateText("Placeholder Text")
SetTextFont(LabelTutorial,GameFont)
SetTextAlignment(LabelTutorial,1)
SetTextPosition(LabelTutorial,60,100)
SetTextSize(LabelTutorial,28)
SetTextMaxWidth(LabelTutorial,350)
SetTextVisible(LabelTutorial,0)
SetTextColor(LabelTutorial,255,255,255,255)

//global LabelEnergy as integer
//global LabelMoney as integer
Expand Down Expand Up @@ -1129,7 +1158,7 @@ function CreateViews()
ViewHoverBed = CreateSprite(ImageHoverBed)
ViewHoverMessages = CreateSprite(ImageHoverMessages)
ViewHoverDoor = CreateSprite(ImageHoverDoor)

ViewTutorial = CreateSprite(ImageTutorial)
AddSpriteAnimationFrame(ViewRunning,ImageRunning[1])
AddSpriteAnimationFrame(ViewRunning,ImageRunning[2])
AddSpriteAnimationFrame(ViewRunning,ImageRunning[3])
Expand Down Expand Up @@ -1469,6 +1498,7 @@ function LoadGame()
Player.Day = val(ReadLine(FileID))
CloseFile(FileID)
endif
Player.Day = Player.Day - 1
NewDay()
LastSecond = 0
CurrentSecond = 0
Expand All @@ -1493,6 +1523,8 @@ endfunction
//Start a New Date
function NewDay()
CurrentDay = CurrentDay + 1
Player.Day = Player.Day + 1
SetTextString(LabelDays,"Day " + str(Player.Day))
for i = 1 to NumLocations


Expand Down Expand Up @@ -1566,6 +1598,10 @@ function NewDay()


next i
if Player.Day = 30 and Player.Cash < 500000
GameOver = 2
Busted()
endif

endfunction

Expand Down Expand Up @@ -1659,6 +1695,7 @@ function SetUI()
SetSpriteDepth(ViewMapLogo,1)
SetSpritePosition(ViewGotAway, ViewLeft + (1136/ 2) - (GetSpriteWidth(ViewGotAway) / 2), ViewTop + (640 / 2) - (GetSpriteHeight(ViewGotAway) / 2))
SetSpriteDepth(ViewGotAway,0)
SetTextPosition(LabelDays, ViewLeft + ScreenWidth / 2,ViewTop + 50)
endfunction

//Start Selling Resources
Expand Down Expand Up @@ -1711,6 +1748,11 @@ function StartSelling()
SetSpriteColor(SceneUI.StopSellingButton,200,200,200,255)
SetSpriteDepth(SceneUI.StopSellingButton,1)
ResetTimer()
if Player.TutorialState < 3
Player.TutorialState = 3
endif


CurrentSecond = 0
LastSecond = 0
endfunction
Expand Down Expand Up @@ -1825,7 +1867,7 @@ endfunction
//Stop Running from the Cops
function StopRunning()
HideElements()

//Player.Energy = Player.Energy + 1
SetSpriteVisible(ViewRunning,0)
SetSpriteVisible(ViewRunningBackground,0)
SetSpriteVisible(ViewRunningBackgroundBlank,0)
Expand Down Expand Up @@ -2121,7 +2163,6 @@ function CheckInput()
endif
endif
endif


if GetPointerState() = 1
pX = GetPointerX()
Expand Down Expand Up @@ -2331,17 +2372,17 @@ function CheckInput()
pX = pX + ViewLeft
pY = pY + ViewTop

SetSpriteColor(SceneUI.BounceButton,255,255,255,255)
SetSpriteColor(SceneUI.SellButton,255,255,255,255)
SetSpriteColor(SceneUI.BounceButton,200,200,200,255)
SetSpriteColor(SceneUI.SellButton,200,200,200,255)

if pX > GetSpriteX(SceneUI.SellButton) and pX < GetSpriteX(SceneUI.SellButton) + GetSpriteWidth(SceneUI.SellButton)
if pY > GetSpriteY(SceneUI.SellButton) and pY < GetSpriteY(SceneUI.SellButton) + GetSpriteHeight(SceneUI.SellButton)
SetSpriteColor(SceneUI.SellButton,50,255,50,255)
SetSpriteColor(SceneUI.SellButton,255,255,255,255)
endif
endif
if pX > GetSpriteX(SceneUI.BounceButton) and pX < GetSpriteX(SceneUI.BounceButton) + GetSpriteWidth(SceneUI.BounceButton)
if pY > GetSpriteY(SceneUI.BounceButton) and pY < GetSpriteY(SceneUI.BounceButton) + GetSpriteHeight(SceneUI.BounceButton)
SetSpriteColor(SceneUI.BounceButton,255,50,50,255)
SetSpriteColor(SceneUI.BounceButton,255,255,255,255)
endif
endif

Expand Down Expand Up @@ -2676,6 +2717,19 @@ function CheckInput()
//Show the Scene
if wX > Button[ButtonGoToLocation].X and wX < Button[ButtonGoToLocation].X + Button[ButtonGoToLocation].Width
if wY > Button[ButtonGoToLocation].Y and wY < Button[ButtonGoToLocation].Y + Button[ButtonGoToLocation].Height
if CurrentLocation = 1
LastViewTop = ViewTop
LastViewLeft = ViewLeft
//ShowScene(CurrentLocation)
tmpLocation = CurrentLocation
StartMoving()
PlaySound(SoundClick)
exitfunction
endif
if Player.Energy <= 0
ShowMap()
ShowObjective(1)
endif
if Player.Energy > 0
LastViewTop = ViewTop
LastViewLeft = ViewLeft
Expand Down Expand Up @@ -3071,6 +3125,33 @@ function ShowScene(ID as Integer)
SetSpriteDepth(SceneUI.Slider2,1)
SetSpriteDepth(SceneUI.Slider3,1)
SetSpriteVisible(Location[Player.CurrentLocation].MapSprite,0)
if Player.TutorialState = 1
SetSpriteVisible(ViewTutorial,1)
SetSpritePosition(ViewTutorial, ViewLeft + 280, ViewTop + 200)
SetTextString(LabelTutorial,"Use the sliders to buy drugs from the thugs!")
SetTextVisible(LabelTutorial,1)
SetTextPosition(LabelTutorial,ViewLeft + 280 + GetSpriteWidth(ViewTutorial) / 2, ViewTop + 210)
SetSpriteDepth(ViewTutorial,1)
SetTextDepth(LabelTutorial,1)
endif
if Player.TutorialState = 2
SetSpriteVisible(ViewTutorial,1)
SetSpritePosition(ViewTutorial, ViewLeft + 280, ViewTop + 200)
SetTextString(LabelTutorial,"Bounce and find a spot to sell these drugs!")
SetTextVisible(LabelTutorial,1)
SetTextPosition(LabelTutorial,ViewLeft + 280 + GetSpriteWidth(ViewTutorial) / 2, ViewTop + 210)
SetSpriteDepth(ViewTutorial,1)
SetTextDepth(LabelTutorial,1)
endif
if Player.TutorialState = 4
SetSpriteVisible(ViewTutorial,1)
SetSpritePosition(ViewTutorial, ViewLeft + 280, ViewTop + 200)
SetTextString(LabelTutorial,"Buy cheap, sell high, get rich! Don't forget to sleep!")
SetTextVisible(LabelTutorial,1)
SetTextPosition(LabelTutorial,ViewLeft + 280 + GetSpriteWidth(ViewTutorial) / 2, ViewTop + 210)
SetSpriteDepth(ViewTutorial,1)
SetTextDepth(LabelTutorial,1)
endif
endif

//If we are at a Sell Location!
Expand Down Expand Up @@ -3324,6 +3405,24 @@ function ShowScene(ID as Integer)
SetTextString(SceneUI.ProcessTitleLabel,"Sold:")
NewHeatbarWidth = Location[Player.CurrentLocation].CurrentHeat / GetSpriteWidth(SceneUI.HeatbarBackground) / (100 / GetSpriteWidth(SceneUI.HeatbarBackground)) * GetSpriteWidth(SceneUI.HeatbarBackground)
OldHeatbarWidth = Location[Player.CurrentLocation].CurrentHeat / GetSpriteWidth(SceneUI.HeatbarBackground) / (100 / GetSpriteWidth(SceneUI.HeatbarBackground)) * GetSpriteWidth(SceneUI.HeatbarBackground)
if Player.TutorialState = 3
SetSpriteVisible(ViewTutorial,1)
SetSpritePosition(ViewTutorial, ViewLeft + 280, ViewTop + 200)
SetTextString(LabelTutorial,"Start selling, if you get busted, run away!")
SetTextVisible(LabelTutorial,1)
SetTextPosition(LabelTutorial,ViewLeft + 280 + GetSpriteWidth(ViewTutorial) / 2, ViewTop + 210)
SetSpriteDepth(ViewTutorial,1)
SetTextDepth(LabelTutorial,1)
endif
if Player.TutorialState = 4
SetSpriteVisible(ViewTutorial,1)
SetSpritePosition(ViewTutorial, ViewLeft + 280, ViewTop + 200)
SetTextString(LabelTutorial,"Buy cheap, sell high, get rich! Don't forget to sleep!")
SetTextVisible(LabelTutorial,1)
SetTextPosition(LabelTutorial,ViewLeft + 280 + GetSpriteWidth(ViewTutorial) / 2, ViewTop + 210)
SetSpriteDepth(ViewTutorial,1)
SetTextDepth(LabelTutorial,1)
endif
endif
SetSpriteVisible(ViewItsTheCops,0)
LastWindow = GameStateInScene
Expand Down Expand Up @@ -3424,6 +3523,7 @@ function GoToSleep()
SetSpriteVisible(ViewBackgroundSleep,1)
SetSpriteDepth(ViewBackgroundSleep,0)
SetSpritePosition(ViewBackgroundSleep,ViewLeft,ViewTop)
NewDay()
SaveGame()
endfunction

Expand Down Expand Up @@ -3487,16 +3587,29 @@ function ShowMap()
SetSpriteVisible(Location[3].MapSprite,1)
endif

if Player.Energy <= 0
ShowObjective(1)
endif

SetTextVisible(LabelDays,1)
SetTextPosition(LabelDays, ViewLeft + ScreenWidth / 2,ViewTop + 100)
SetTextDepth(LabelDays,1)

SaveGame()

//message("HERE")
//Reset the UI Elements
SetUI()
SetSpriteDepth(ViewGotAway,0)
if Player.TutorialState = 2
Player.TutorialState = 3
exitfunction
endif
if Player.TutorialState = 3
Player.TutorialState = 4
exitfunction
endif
if Player.TutorialState = 4
Player.TutorialState = 5
exitfunction
endif
endfunction

//Show the Messages from the Users Phone
Expand Down Expand Up @@ -3553,7 +3666,7 @@ function ShowObjective(ID as integer)
SetTextString(LabelObjective,Objective[ID].LabelString)
SetTextPosition(LabelObjective,ViewLeft + (ScreenWidth / 2), ViewTop + 300)
Button[ButtonAcceptObjective].X = ViewLeft + (ScreenWidth / 2) - (GetSpriteWidth(Button[ButtonAcceptObjective].Sprite) / 2)
Button[ButtonAcceptObjective].Y = 400
Button[ButtonAcceptObjective].Y = ViewTop + 400
SetTextVisible(Button[ButtonAcceptObjective].Label,1)
SetSpritePosition(Button[ButtonAcceptObjective].Sprite,Button[ButtonAcceptObjective].X,Button[ButtonAcceptObjective].Y)
SetTextPosition(Button[ButtonAcceptObjective].Label,Button[ButtonAcceptObjective].X + 180,Button[ButtonAcceptObjective].Y + 20)
Expand Down Expand Up @@ -3626,6 +3739,13 @@ function Busted()
Cost = 100000
endif

if GameOver = 2
SetSpriteVisible(ViewBusted,0)
SetTextString(LabelBusted,"You didn't earn back the $500,000 in bad debt. You were never heard from again. Fuck.")
SetTextString(Button[ButtonBustedContinue].Label,"Return to main Menu")
GameOver = 1
exitfunction
endif
//If they can afford it! Let's post bail!
if Player.Cash => Cost
Player.Cash = Player.Cash - Cost
Expand Down Expand Up @@ -3683,6 +3803,7 @@ function NewGame()
Player.Energy = 10
Player.CurrentMessage = 1
Player.TutorialState = 1
Player.Day = 0
SetSpriteVisible(Player.Sprite,1)
SetSpritePosition(Player.Sprite,Player.X,Player.Y)
NewDay()
Expand Down Expand Up @@ -3812,6 +3933,7 @@ function HideElements()
SetTextVisible(SceneUI.MoneyLabel,0)
SetTextVisible(LabelMessageTitle,0)
SetTextVisible(LabelMessageBody,0)
SetTextVisible(LabelDays,0)

SetSpriteVisible(SceneUI.Background,0)
SetSpriteVisible(SceneUI.Resource1Checkbox,0)
Expand Down Expand Up @@ -3873,7 +3995,8 @@ function HideElements()
SetSpriteVisible(ViewBusted,0)
SetTextVisible(LabelBusted,0)
SetSpriteVisible(ViewBackgroundSleep,0)

SetSpriteVisible(ViewTutorial,0)
SetTextVisible(LabelTutorial,0)
endfunction

//Show the Location Information when you click on a new location
Expand Down
Binary file added media/BikersMapIcon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/FernwallMap.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions media/Locations/Locations.dat
@@ -1,5 +1,9 @@
4
8
Your House,House.png,Miami.ogg,BuyButton.png,50,300,SellButton.png,50,400,HospitalIcon.png,300,50,TravelIcon.png,800,230,HouseMapIcon.png,500,300,400,300,0,0,0,0,0,0,0,0,0,0,0,0,
Downtown,House.png,Miami.ogg,BuyButton.png,50,400,SellButton.png,50,400,HospitalIcon.png,300,50,TravelIcon.png,600,50,DowntownMap.png,600,600,400,300,0,0,0,0,1,1,1,1,1,1,0,0,0,
Crude Bois,Thugs.png,Miami.ogg,BuyButton.png,50,400,SellButton.png,50,400,HospitalIcon.png,300,50,TravelIcon.png,600,50,ThugsMapIcon.png,900,300,400,300,0,0,0,0,2,1,1,1,0,0,1,2,3,
Avenue,House.png,Miami.ogg,BuyButton.png,50,400,SellButton.png,50,400,HospitalIcon.png,300,50,TravelIcon.png,600,50,AvenueMap.png,1400,800,0,0,0,0,0,100,1,1,1,1,1,1,0,0,0,
Avenue,House.png,Miami.ogg,BuyButton.png,50,400,SellButton.png,50,400,HospitalIcon.png,300,50,TravelIcon.png,600,50,AvenueMap.png,1400,800,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,
Thugs,Thugs.png,Miami.ogg,BuyButton.png,50,400,SellButton.png,50,400,HospitalIcon.png,300,50,TravelIcon.png,600,50,ThugsMapIcon2.png,500,900,400,300,0,0,0,0,2,1,1,1,0,0,2,3,4,
Browns Park,House.png,Miami.ogg,BuyButton.png,50,400,SellButton.png,50,400,HospitalIcon.png,300,50,TravelIcon.png,600,50,BrownMap.png,1000,500,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,
The Knights,bikers.png,Miami.ogg,BuyButton.png,50,400,SellButton.png,50,400,HospitalIcon.png,300,50,TravelIcon.png,600,50,BikersMapIcon.png,1700,800,400,300,0,0,0,0,2,1,1,1,0,0,3,4,5,
Fernwall,House.png,Miami.ogg,BuyButton.png,50,400,SellButton.png,50,400,HospitalIcon.png,300,50,TravelIcon.png,600,50,FernwallMap.png,1300,300,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,
Binary file added media/ThugsMapIcon2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/Title.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/TutorialRight.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/bytecode.byc
Binary file not shown.

0 comments on commit dde4d81

Please sign in to comment.