Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var chars : array char of boolean
- var chars2 : array char of boolean
- var ld : string
- var pms : string
- var mc : int
- var s : int
- var x : int %pacmans x
- var y : int %pacmans y
- var rx : int %red pacmans x
- var ry : int %red pacmans y
- var dx1 : int
- var dy1 : int
- var sd : int
- var radx1 : int
- var radx2 : int
- var rady1 : int
- var rady2 : int
- var rradx1 : int
- var rradx2 : int
- var rrady1 : int
- var rrady2 : int
- rx := 125
- ry := 75
- sd := 1
- s := 10 %pacmans speed
- x := 500 %pacmans starting x position
- y := 75 %pacmans starting y position
- mc := 9
- radx1 := x + 15
- radx2 := x - 15
- rady1 := y + 15
- rady2 := y - 15
- rradx1 := rx + 15
- rradx2 := rx - 15
- rrady1 := ry + 15
- rrady2 := ry - 15
- setscreen ("graphics:1000;500") %size of the run screen
- colorback (7)
- cls
- loop
- Draw.ThickLine (100, 50, 900, 50, 10, mc)
- Draw.ThickLine (100, 50, 100, 450, 10, mc)
- Draw.ThickLine (100, 450, 900, 450, 10, mc)
- Draw.ThickLine (900, 450, 900, 50, 10, mc)
- drawbox (600, 350, 850, 400, mc)
- drawbox (150, 350, 450, 400, mc)
- drawbox (500, 400, 550, 200, mc)
- drawbox (150, 300, 400, 250, mc)
- drawbox (650, 250, 850, 300, mc)
- drawbox (150, 100, 850, 150, mc)
- Input.KeyDown (chars)
- Input.KeyDown (chars2)
- if chars (KEY_UP_ARROW) then
- y := y + 1
- x := x
- ld := "u"
- radx1 := x + 15
- radx2 := x - 15
- rady1 := y + 15
- rady2 := y - 15
- drawfilloval (x, y, 15, 15, 43)
- drawfillarc (x, y, 15, 15, 70, 120, 7)
- delay (s)
- elsif chars (KEY_DOWN_ARROW) then
- y := y - 1
- x := x
- ld := "d"
- radx1 := x + 15
- radx2 := x - 15
- rady1 := y + 15
- rady2 := y - 15
- drawfilloval (x, y, 15, 15, 43)
- drawfillarc (x, y, 15, 15, 230, 310, 7)
- delay (s)
- elsif chars (KEY_LEFT_ARROW) then
- y := y
- x := x - 1
- ld := "l"
- radx1 := x + 15
- radx2 := x - 15
- rady1 := y + 15
- rady2 := y - 15
- drawfilloval (x, y, 15, 15, 43)
- drawfillarc (x, y, 15, 15, 130, 210, 7)
- delay (s)
- elsif chars (KEY_RIGHT_ARROW) then
- y := y
- x := x + 1
- ld := "r"
- radx1 := x + 15
- radx2 := x - 15
- rady1 := y + 15
- rady2 := y - 15
- drawfilloval (x, y, 15, 15, 43)
- drawfillarc (x, y, 15, 15, 310, 40, 7)
- delay (s)
- else
- drawfilloval (x, y, 15, 15, 43)
- delay (s)
- end if
- drawfilloval (x, y, 15, 15, black)
- if x = 0 then
- x := 1000
- elsif x = 1000 then
- x := 0
- elsif y = 0 then
- y := 500
- elsif y = 500 then
- y := 0
- end if
- if chars ('0') then
- colour (white)
- put "BOOST ENABLED"
- s := 5
- else
- s := 10
- end if
- if y < 72 then
- y := y + 1
- elsif x < 122 then
- x := x + 1
- elsif y > 425 then
- y := y - 1
- elsif x > 874 then
- x := x - 1
- elsif x < 870 and x > 580 and y = 330 then
- y := y - 1
- elsif x = 580 and y < 420 and y > 330 then
- x := x - 1
- elsif x = 870 and y < 420 and y > 330 then
- x := x + 1
- elsif x < 870 and x > 580 and y = 422 then
- y := y + 1
- elsif x < 470 and x > 130 and y = 330 then
- y := y - 1
- elsif x = 130 and y < 420 and y > 330 then
- x := x - 1
- elsif x = 470 and y < 420 and y > 330 then
- x := x + 1
- elsif x > 130 and x < 470 and y = 420 then
- y := y + 1
- elsif x > 130 and x < 870 and y = 170 then
- y := y + 1
- elsif x > 130 and x < 870 and y = 80 then
- y := y - 1
- elsif x = 130 and y < 170 and y > 80 then
- x := x - 1
- elsif x = 870 and y < 170 and y > 80 then
- x := x + 1
- elsif x = 570 and y < 420 and y > 180 then
- x := x + 1
- elsif x = 480 and y < 420 and y > 180 then
- x := x - 1
- elsif y = 420 and x > 480 and x < 570 then
- y := y + 1
- elsif y = 180 and x > 480 and x < 570 then
- y := y - 1
- elsif y = 320 and x < 420 and x > 130 then
- y := y + 1
- end if
- if y = 230 and x < 420 and x > 130 then
- y := y - 1
- elsif x = 130 and y < 320 and y > 230 then
- x := x - 1
- elsif x = 420 and y < 320 and y > 230 then
- x := x + 1
- elsif y = 320 and x > 630 and x < 870 then
- y := y + 1
- elsif y = 230 and x > 630 and x < 870 then
- y := y - 1
- elsif x = 630 and y > 230 and y < 320 then
- x := x - 1
- elsif x = 870 and y > 230 and y < 320 then
- x := x + 1
- end if
- if ry < 72 then
- ry := ry + 1
- elsif rx < 122 then
- rx := rx + 1
- elsif ry > 425 then
- ry := ry - 1
- elsif rx > 874 then
- rx := rx - 1
- elsif rx < 870 and rx > 580 and ry = 330 then
- ry := ry - 1
- elsif rx = 580 and ry < 420 and ry > 330 then
- rx := rx - 1
- elsif rx = 870 and ry < 420 and ry > 330 then
- rx := rx + 1
- elsif rx < 870 and rx > 580 and ry = 422 then
- ry := ry + 1
- elsif rx < 470 and rx > 130 and ry = 330 then
- ry := ry - 1
- elsif rx = 130 and ry < 420 and ry > 330 then
- rx := rx - 1
- elsif rx = 470 and ry < 420 and ry > 330 then
- rx := rx + 1
- elsif rx > 130 and rx < 470 and ry = 420 then
- ry := ry + 1
- elsif rx > 130 and rx < 870 and ry = 170 then
- ry := ry + 1
- elsif rx > 130 and rx < 870 and ry = 80 then
- ry := ry - 1
- elsif rx = 130 and ry < 170 and ry > 80 then
- rx := rx - 1
- elsif rx = 870 and ry < 170 and ry > 80 then
- rx := rx + 1
- elsif rx = 570 and ry < 420 and ry > 180 then
- rx := rx + 1
- elsif rx = 480 and ry < 420 and ry > 180 then
- rx := rx - 1
- elsif ry = 420 and rx > 480 and rx < 570 then
- ry := ry + 1
- elsif ry = 180 and rx > 480 and rx < 570 then
- ry := ry - 1
- elsif ry = 320 and rx < 420 and rx > 130 then
- ry := ry + 1
- elsif ry = 230 and rx < 420 and rx > 130 then
- ry := ry - 1
- elsif rx = 130 and ry < 320 and ry > 230 then
- rx := rx - 1
- elsif rx = 420 and ry < 320 and ry > 230 then
- rx := rx + 1
- elsif ry = 320 and rx > 630 and rx < 870 then
- ry := ry + 1
- elsif ry = 230 and rx > 630 and rx < 870 then
- ry := ry - 1
- elsif rx = 630 and ry > 230 and ry < 320 then
- rx := rx - 1
- elsif rx = 870 and ry > 230 and ry < 320 then
- rx := rx + 1
- end if
- if chars2 ('w') then
- ry := ry + 1
- rx := rx
- ld := "u"
- rradx1 := rx + 15
- rradx2 := rx - 15
- rrady1 := ry + 15
- rrady2 := ry - 15
- drawfilloval (rx, ry, 15, 15, 12)
- drawfillarc (rx, ry, 15, 15, 70, 120, 7)
- delay (s)
- elsif chars2 ('s') then
- ry := ry - 1
- rx := rx
- ld := "d"
- rradx1 := rx + 15
- rradx2 := rx - 15
- rrady1 := ry + 15
- rrady2 := ry - 15
- drawfilloval (rx, ry, 15, 15, 12)
- drawfillarc (rx, ry, 15, 15, 230, 310, 7)
- delay (s)
- elsif chars2 ('a') then
- ry := ry
- rx := rx - 1
- ld := "l"
- rradx1 := rx + 15
- rradx2 := rx - 15
- rrady1 := ry + 15
- rrady2 := ry - 15
- drawfilloval (rx, ry, 15, 15, 12)
- drawfillarc (rx, ry, 15, 15, 130, 210, 7)
- delay (s)
- elsif chars2 ('d') then
- ry := ry
- rx := rx + 1
- ld := "r"
- rradx1 := rx + 15
- rradx2 := rx - 15
- rrady1 := ry + 15
- rrady2 := ry - 15
- drawfilloval (rx, ry, 15, 15, 12)
- drawfillarc (rx, ry, 15, 15, 310, 40, 7)
- delay (s)
- else
- drawfilloval (rx, ry, 15, 15, 12)
- delay (s)
- end if
- if whatdotcolour (rx + 15, ry + 2) = 43 or whatdotcolour (rx + 15, ry + 15) = 43 or
- whatdotcolour (rx + 15, ry + 15) = 43 or whatdotcolour (rx + 15, ry + 15) = 43 or
- whatdotcolour (rx + 15, ry + 15) = 43 or whatdotcolour (rx + 15, ry + 15) = 43 or
- whatdotcolour (rx + 15, ry + 15) = 43 or whatdotcolour (rx + 15, ry + 15) = 43 then
- exit
- end if
- cls
- end loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement