Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'Kinda maze runner
- GraphicsWindow.Width =1080
- GraphicsWindow.Height = 720
- GraphicsWindow.KeyDown = OnKeyDown
- GraphicsWindow.Title = "Kinda Maze Run Game"
- GraphicsWindow.BackgroundColor = "#81F781"
- start:
- g1size=32
- g1 = Shapes.AddImage("C:\Users\deqnb\Desktop\Maze escape\stickcho.png")
- Controls.SetSize(g1, g1size, g1size)
- stepg1 = 20
- stepg = 5
- g2 = Shapes.AddImage("C:\Users\deqnb\Desktop\Maze escape\girl.png")
- Controls.SetSize(g2, g1size, g1size)
- g2locx = 1000
- g2locy = 650
- Shapes.move(g2, g2locx, g2locy)
- wallsSize = -1
- wallStandartHight = 980 'дължината
- wallstandartWeight = 10 'ширината
- wallposex = 100
- wallposey = 50
- registerwall()
- wallposey = 150
- registerwall()
- 'левите числа са ми за позицията на ляво и надясно
- wall01 = Shapes.AddRectangle(wallStandartHight , wallstandartWeight)
- Shapes.Move (wall01, wallposex, wallposey)
- wall02 = Shapes.AddRectangle(wallStandartHight , wallstandartWeight)
- Shapes.Move (wall02, wallposex + 500 , wallposey - 30 )
- wall03 = Shapes.AddRectangle(wallStandartHight - 200, wallstandartWeight)
- Shapes.Move (wall03, wallposex - 200, wallposey + 60)
- wall04 = Shapes.AddRectangle(wallStandartHight - 800, wallstandartWeight)
- Shapes.Move (wall04, wallposex + 800, wallposey + 60)
- wall05 = Shapes.AddRectangle(wallStandartHight , wallstandartWeight)
- Shapes.Move (wall05, wallposex , wallposey + 150)
- vertwall = Shapes.AddRectangle( wallstandartWeight, wallStandartHight)
- Shapes.Move (vertwall , wallposex + 200, wallposey + 250 )
- vertwall02 = Shapes.AddRectangle( wallstandartWeight, wallStandartHight)
- Shapes.Move (vertwall02 , wallposex + 800, wallposey + 450 )
- vertwall03 = Shapes.AddRectangle( wallstandartWeight , wallStandartHight - 700)
- Shapes.Move (vertwall03 , wallposex + 100, wallposey + 130 )
- vertwall04 = Shapes.AddRectangle( wallstandartWeight , wallStandartHight - 700)
- Shapes.Move (vertwall04 , wallposex + 40, wallposey + 230 )
- vertwall05 = Shapes.AddRectangle( wallstandartWeight , 435)
- Shapes.Move (vertwall05 , 40, wallposey + 230 )
- wall06 = Shapes.AddRectangle(wallStandartHight - 500 , wallstandartWeight )
- Shapes.Move (wall06, 0 , wallposey + 560)
- wall07 = Shapes.AddRectangle(wallStandartHight - 800 , wallstandartWeight )
- Shapes.Move (wall07, 500 , wallposey + 460)
- vertwall06 = Shapes.AddRectangle( wallstandartWeight , 135)
- Shapes.Move (vertwall06 , 370, wallposey + 150 )
- wall08 = Shapes.AddRectangle(wallStandartHight - 800 , wallstandartWeight )
- Shapes.Move (wall08, 700 , 370)
- wall09 = Shapes.AddRectangle(wallStandartHight - 800 , wallstandartWeight )
- Shapes.Move (wall09, 300 , 470)
- wall10 = Shapes.AddRectangle(wallStandartHight - 800 , wallstandartWeight )
- Shapes.Move (wall10, 500 , 250)
- vertwall07 = Shapes.AddRectangle(wallstandartWeight ,wallStandartHight -700)
- Shapes.Move (vertwall07, 605, 355)
- vertwall08 = Shapes.AddRectangle(wallstandartWeight ,wallStandartHight -600)
- Shapes.Move (vertwall08, 805, 255)
- vertwall09 = Shapes.AddRectangle(wallstandartWeight ,wallStandartHight -900)
- Shapes.Move (vertwall09, 605, 187)
- wall11 = Shapes.AddRectangle(wallStandartHight - 100 , wallstandartWeight )
- Shapes.Move (wall11, 850 , 300)
- wall12 = Shapes.AddRectangle(wallStandartHight - 850 , wallstandartWeight )
- Shapes.Move (wall12, 100 , 500)
- 'начи по някаква причина всичок след първите while и if не работи.
- 'пробвах при по-малък прототип на програмата, но пак се получи същото
- Sub Registerwall
- wall01 = Shapes.AddRectangle(wallStandartHight , wallstandartWeight)
- Shapes.Move (wall01, wallposex, wallposey)
- wallsSize = wallsSize + 1
- walls[wallsSize]["x"]=wallposex
- walls[wallsSize]["y"]=wallposey
- walls[wallsSize]["height"]=wallStandartHight
- walls[wallsSize]["width"]=wallstandartWeight
- EndSub
- Sub ChekForCollision
- For i = 0 To wallsSize
- cObX = walls[i]["x"]
- cObY = walls[i]["y"]
- cObW = walls[i]["width"]
- cObH = walls[i]["height"]
- If x + g1size >= cObX And x <= cObX + cObX And y + g1size >= cObY and y <= cObY + cObH Then
- GraphicsWindow.ShowMessage("Загуби! " , "Опа" )
- GraphicsWindow.Clear()
- Goto start
- EndIf
- EndFor
- If x + g1Size >= g2LocX And x <= g2LocX + g1Size And y + g1Size >= g2LocY And y <= g2LocY + g1Size then
- GraphicsWindow.ShowMessage("Браво спечели играта!", "Поздравления")
- EndIf
- EndSub
- Sub OnKeyDown
- y = Shapes.GetTop(g1)
- x = Shapes.GetLeft (g1)
- 'lqvo
- If GraphicsWindow.LastKey = "Left" Then
- x = x - stepg
- EndIf
- 'dqsno
- If GraphicsWindow.LastKey = "Right"Then
- x = x + stepg
- EndIf
- 'gore
- If GraphicsWindow.LastKey = "Up"Then
- y = y - stepg
- EndIf
- 'dolu
- If GraphicsWindow.LastKey = "Down" Then
- y = y + stepg
- EndIf
- Shapes.Move (g1,x,y)
- EndSub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement