// Project: Golf Card Game // Created: 19-05-15 // show all errors SetErrorMode(2) // set window properties SetWindowTitle("Golf Card Game") SetWindowSize(1024, 768, 0) //SetWindowSize(1000, 1000, 0) SetWindowAllowResize(1) // allow the user to resize the window // set display properties SetVirtualResolution(1024, 768) // doesn't have to match the window //SetVirtualResolution(1000, 1000) // doesn't have to match the window SetOrientationAllowed(1, 1, 1, 1) // allow both portrait and landscape on mobile devices SetSyncRate(30, 0) // 30fps instead of 60 to save battery SetScissor(0, 0, 0, 0) // use the maximum available screen space, no black borders UseNewDefaultFonts(1) CardX as Float CardY as Float CardName as String CardValue as String NumPlayers as Integer PlayerIncrement as Float PlayerPosX as Float [10] PlayerPosY as float [10] PlayerAngle as float [10] CardAngle as Integer [60] NumberOfCards as Integer CardLocationX as Float [60] //Sprite #, X position CardLocationY as Float [60] //Sprite #, Y position CardIncrementX as Integer [13] CardIncrementY as Integer [13] Move as Integer [10] OriginalX as Float[60] OriginalY as Float[60] DistanceX as Float[60] DistanceY as Float[60] DistanceFromAtoB as Float[60] DirectionX as Float[60] DirectionY as Float[60] NewX as Float NewY as Float OffsetX as Float[6] OffsetY as Float[6] NumPlayers = 4 //Use this during programming. Remove when user input is implemented. If (NumPlayers = 2) CardLocationX.Length = 60 CardLocationY.Length = 60 NumberOfCards = 60 OriginalX.Length = 60 OriginalY.Length = 60 DistanceX.Length = 60 DistanceY.Length = 60 DistanceFromAtoB.Length = 60 DirectionX.Length = 60 DirectionY.Length = 60 elseif ((NumPlayers = 3) or (NumPlayers = 4) or (NumPlayers = 5)) CardLocationX.Length = 120 CardLocationY.Length = 120 NumberOfCards = 120 OriginalX.Length = 120 OriginalY.Length = 120 DistanceX.Length = 120 DistanceY.Length = 120 DistanceFromAtoB.Length = 120 DirectionX.Length = 120 DirectionY.Length = 120 elseif ((NumPlayers >= 6) and (NumPlayers <= 9)) CardLocationX.Length = 180 CardLocationY.Length = 180 NumberOfCards = 180 OriginalX.Length = 180 OriginalY.Length = 180 DistanceX.Length = 180 DistanceY.Length = 180 DistanceFromAtoB.Length = 180 DirectionX.Length = 180 DirectionY.Length = 180 elseif (NumPlayers = 10) CardLocationX.Length = 240 CardLocationY.Length = 240 NumberOfCards = 240 OriginalX.Length = 240 OriginalY.Length = 240 DistanceX.Length = 240 DistanceY.Length = 240 DistanceFromAtoB.Length = 240 DirectionX.Length = 240 DirectionY.Length = 240 endif #Include "SpriteCreate.agc" #Include "DealCards.agc" //Create and display the background LoadImage(1000,"Blackjack-Felt-Texture_1024x768.png") CreateSprite(1000,1000) //LoadImage(1,"CardBack.png") //CreateSprite(1,1) GoSub SpriteCreate GoSub DealCards //Put this back in once we fix DealCards //do // Sync() //Loop //If GetPointerPressed() = 1 //Print("We are just before the deal") //Endif //Test Area to see how moving the cards work //Do /* PlayerAngle[1] = 360 PlayerPosX[1] = GetVirtualWidth()/2 //- (GetVirtualHeight()/2 * tan(PlayerAngle[1])) - GetSpriteWidth(1) PlayerPosY[1] = GetSpriteHeight(1)/2 CardAngle[1] = 90 SetSpritePosition(1, PlayerPosX[1], PlayerPosY[1]) SetSpriteAngle(1,0) */ // Sync() //Loop // //gosub Deal //Put this back in once we fix DealCards Do Sync() loop