What is it you are trying to achieve?
<Replace all the <> with your answers/code and remove the <>>
What is the problem you are having?
Screen Flickers too much due to the nature of the way I generated the bullets.
Collision with edge of screen not working. Boot collision with the black part of the portal doesnt work
Describe what you have tried to solve this problem
Tried using various types of arrays and configurations with arrays to help with the bullet problem. Tried moving the View.Update to various sensible places in the program. Tried using only one view.update (which didnt work).
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
My game
Turing: |
% Declare Variables
var CXBLSSBbody, CYBLSSBbody, CXTRSSBbody, CYTRSSBbody, CXSBarm, CYSBarm, CXRSBarm, CYRSBarm, CXSBfan, CYSBfan, CXRSBfan : int
var CYRSBfan, CXBLSSBhead, CYBLSSBhead, CXTRSSBhead, CYTRSSBhead, CXBLSSBleftleg, CYBLSSBleftleg, CXTRSSBleftleg : int
var CYTRSSBleftleg, CXBLSSBrightleg, CYBLSSBrightleg, CXTRSSrightleg, CYTRSSBrightleg, CXBLSSBleftshoe, CYBLSSBleftshoe : int
var CXTRSSBleftshoe, CYTRSSBleftshoe, CXBLSSBrightshoe, CYBLSSBrightshoe, CXTRSSrightshoe, CYTRSSBrightshoe : int
var CXSBlefteye, CYSBlefteye, CXRSBlefteye, CYRSBlefteye, CXSBrighteye, CYSBrighteye, CXRSBrighteye, CYRSBrighteye : int
var CXBLP, CYBLP, CXRSBbiglandingpad, CYRBLP, CXSLP, CYSLP, CXRSLP, CYRSLP, CXESbody, CYESbody, CXRESbody, CYRESbody : int
var CX1ESspiketopleft, CX2ESspiketopleft, XY1ESspiketopleft, CY2spiketopleft, CX1ESspiketopright, CX2ESspiketopright : int
var XY1ESspiketopright, CY2spiketopright, CX1ESspikebottomleft, CX2ESspikebottomleft, XY1ESspikebottomleft : int
var CY2spikebottomleft, CX1ESspikebottomright, CX2ESspikebottomright, XY1ESspikebottomright, CY2spikebottomright : int
var CX1ESspikeleftleft, CX2ESspikeleftleft, XY1ESspikeleftleft, CY2spikeleftleft, CX1ESspikeleftright : int
var CX2ESspikeleftright, XY1ESspikeleftright, CY2spikeleftright, CX1ESspikerightleft, CX2ESspikerightleft : int
var XY1ESspikerightleft, CY2spikerightleft, CX1ESspikerightright, CX2ESspikerightright, XY1ESspikerightright : int
var CY2spikerightright, CXBLSP, CYBLSP, CXTRSP, CYTRSP, CXB, CYB, CXRB, CYRB, CXBLSBH, CYBLSBH, CXTRSBH, CYTRSBH : int
var life, speed : int
var ch : string (1)
% Assign Values to Big Landing Pad
CXBLP := 50
CYBLP := 0
CXRSBbiglandingpad := 50
CYRBLP := 15
% Assign Values to Small Landing Pad
CXSLP := 50
CYSLP := 0
CXRSLP := 25
CYRSLP := 7
% Assign Values to Portal
CXBLSP := 600
CYBLSP := 0
CXTRSP := 640
CYTRSP := 150
% Assign Values to Blaster
CXB := 640
CYB := 250
CXRB := 100
CYRB := 25
% Assign Values to Black Hole
CXBLSBH := (maxx div 2) - 125
CYBLSBH := 0
CXTRSBH := (maxx div 2) + 125
CYTRSBH := 300
process Grid
for x : 1 .. 640 by 20
for y : 1 .. 420 by 20
drawbox (x, y, x + 20, y + 20, black)
end for
end for
end Grid
process ParticleGenerationScrapBoy
View.Set ("offscreenonly")
var a : int := 1
var xe, ye : array 1 .. a + 1 of int
var speed : int := 1
a + = 1
xe (a ) := CXRSBarm
ye (a ) := CYSBarm + ((CYRSBarm - CYSBarm ) div 2)
loop
drawfilloval (xe (a ), ye (a ), 10 + 3, 10 + 3, white)
% Draw BG
drawfillbox (0, 0, maxx, maxy, gray)
% Draw Landing Pad
drawfilloval (CXBLP, CYBLP, CXRSBbiglandingpad, CYRBLP, 25)
drawfilloval (CXSLP, CYSLP, CXRSLP, CYRSLP, 12)
% Draw Robot
drawfillbox (CXSBarm - 2, CYSBarm - 2, CXRSBarm + 2, CYRSBarm + 2, black)
drawfillbox (CXSBarm, CYSBarm, CXRSBarm, CYRSBarm, 122)
drawfillbox (CXBLSSBbody - 1, CYBLSSBbody - 1, CXTRSSBbody + 1, CYTRSSBbody + 1, black)
drawfillbox (CXBLSSBbody, CYBLSSBbody, CXTRSSBbody, CYTRSSBbody, 92)
drawfilloval (CXSBfan, CYSBfan, CXRSBfan + 2, CYRSBfan + 2, black)
drawfilloval (CXSBfan, CYSBfan, CXRSBfan, CYRSBfan, 13)
drawfillbox (CXBLSSBhead - 2, CYBLSSBhead - 2, CXTRSSBhead + 2, CYTRSSBhead + 2, black)
drawfillbox (CXBLSSBhead, CYBLSSBhead, CXTRSSBhead, CYTRSSBhead, 54)
drawfillbox (CXBLSSBleftleg, CYBLSSBleftleg, CXTRSSBleftleg, CYTRSSBleftleg, 81)
drawfillbox (CXBLSSBrightleg, CYBLSSBrightleg, CXTRSSrightleg, CYTRSSBrightleg, 81)
drawfillbox (CXBLSSBleftshoe - 1, CYBLSSBleftshoe - 1, CXTRSSBleftshoe + 1, CYTRSSBleftshoe + 1, black)
drawfillbox (CXBLSSBleftshoe, CYBLSSBleftshoe, CXTRSSBleftshoe, CYTRSSBleftshoe, 51)
drawfillbox (CXBLSSBrightshoe - 1, CYBLSSBrightshoe + - 1, CXTRSSrightshoe + 1, CYTRSSBrightshoe + 1, black)
drawfillbox (CXBLSSBrightshoe, CYBLSSBrightshoe, CXTRSSrightshoe, CYTRSSBrightshoe, 51)
drawfilloval (CXSBlefteye, CYSBlefteye, CXRSBlefteye, CYRSBlefteye, 12)
drawfilloval (CXSBrighteye, CYSBrighteye, CXRSBrighteye, CYRSBrighteye, 12)
drawfilloval (CXSBlefteye, CYSBlefteye, CXRSBlefteye - 3, CYRSBlefteye - 3, black)
drawfilloval (CXSBrighteye, CYSBrighteye, CXRSBrighteye - 3, CYRSBrighteye - 3, black)
drawfilloval (CXSBlefteye + 2, CYSBlefteye + 2, CXRSBlefteye - 5, CYRSBlefteye - 5, white)
drawfilloval (CXSBrighteye + 2, CYSBrighteye + 2, CXRSBrighteye - 5, CYRSBrighteye - 5, white)
% Draw Portal
drawfillbox (CXBLSP, CYBLSP, CXTRSP, CYTRSP, blue)
% Draw Blaster
drawfilloval (CXB, CYB, CXRB, CYRB, 122)
%Draw Black Hole
drawfillbox (CXBLSBH - 10, CYBLSBH, CXTRSBH + 10, CYTRSBH + 10, purple)
drawfillbox (CXBLSBH, CYBLSBH, CXTRSBH, CYTRSBH, black)
xe (a ) := xe (a ) + speed
drawfilloval (xe (a ), ye (a ), 10 + 3, 10 + 3, yellow)
drawfilloval (xe (a ), ye (a ), 10, 10, red)
put life
View.Update
exit when xe (a ) = maxx + 100
end loop
end ParticleGenerationScrapBoy
process ParticleGenerationBlaster
View.Set ("offscreenonly")
var xp, yp : array 1 .. 6 of int
var speed : int := 1
xp (1) := CXB - 100
yp (1) := CYB
xp (2) := CXB - 100
yp (2) := CYB
loop
drawfilloval (xp (1), yp (1), 10 + 3, 10 + 3, white)
drawfilloval (xp (2), yp (2), 10 + 3, 10 + 3, white)
% Draw BG
drawfillbox (0, 0, maxx, maxy, gray)
% Draw Landing Pad
drawfilloval (CXBLP, CYBLP, CXRSBbiglandingpad, CYRBLP, 25)
drawfilloval (CXSLP, CYSLP, CXRSLP, CYRSLP, 12)
% Draw Robot
drawfillbox (CXSBarm - 2, CYSBarm - 2, CXRSBarm + 2, CYRSBarm + 2, black)
drawfillbox (CXSBarm, CYSBarm, CXRSBarm, CYRSBarm, 122)
drawfillbox (CXBLSSBbody - 1, CYBLSSBbody - 1, CXTRSSBbody + 1, CYTRSSBbody + 1, black)
drawfillbox (CXBLSSBbody, CYBLSSBbody, CXTRSSBbody, CYTRSSBbody, 92)
drawfilloval (CXSBfan, CYSBfan, CXRSBfan + 2, CYRSBfan + 2, black)
drawfilloval (CXSBfan, CYSBfan, CXRSBfan, CYRSBfan, 13)
drawfillbox (CXBLSSBhead - 2, CYBLSSBhead - 2, CXTRSSBhead + 2, CYTRSSBhead + 2, black)
drawfillbox (CXBLSSBhead, CYBLSSBhead, CXTRSSBhead, CYTRSSBhead, 54)
drawfillbox (CXBLSSBleftleg, CYBLSSBleftleg, CXTRSSBleftleg, CYTRSSBleftleg, 81)
drawfillbox (CXBLSSBrightleg, CYBLSSBrightleg, CXTRSSrightleg, CYTRSSBrightleg, 81)
drawfillbox (CXBLSSBleftshoe - 1, CYBLSSBleftshoe - 1, CXTRSSBleftshoe + 1, CYTRSSBleftshoe + 1, black)
drawfillbox (CXBLSSBleftshoe, CYBLSSBleftshoe, CXTRSSBleftshoe, CYTRSSBleftshoe, 51)
drawfillbox (CXBLSSBrightshoe - 1, CYBLSSBrightshoe + - 1, CXTRSSrightshoe + 1, CYTRSSBrightshoe + 1, black)
drawfillbox (CXBLSSBrightshoe, CYBLSSBrightshoe, CXTRSSrightshoe, CYTRSSBrightshoe, 51)
drawfilloval (CXSBlefteye, CYSBlefteye, CXRSBlefteye, CYRSBlefteye, 12)
drawfilloval (CXSBrighteye, CYSBrighteye, CXRSBrighteye, CYRSBrighteye, 12)
drawfilloval (CXSBlefteye, CYSBlefteye, CXRSBlefteye - 3, CYRSBlefteye - 3, black)
drawfilloval (CXSBrighteye, CYSBrighteye, CXRSBrighteye - 3, CYRSBrighteye - 3, black)
drawfilloval (CXSBlefteye + 2, CYSBlefteye + 2, CXRSBlefteye - 5, CYRSBlefteye - 5, white)
drawfilloval (CXSBrighteye + 2, CYSBrighteye + 2, CXRSBrighteye - 5, CYRSBrighteye - 5, white)
% Draw Portal
drawfillbox (CXBLSP, CYBLSP, CXTRSP, CYTRSP, blue)
% Draw Blaster
drawfilloval (CXB, CYB, CXRB, CYRB, 122)
%Draw Black Hole
drawfillbox (CXBLSBH - 10, CYBLSBH, CXTRSBH + 10, CYTRSBH + 10, purple)
drawfillbox (CXBLSBH, CYBLSBH, CXTRSBH, CYTRSBH, black)
xp (1) := xp (1) - speed
xp (2) := xp (2) - speed
drawfilloval (xp (1), yp (1), 10 + 3, 10 + 3, yellow)
drawfilloval (xp (1), yp (1), 10, 10, red)
if xp (1) = CXB - 200
then
drawfilloval (xp (2), yp (2), 10 + 3, 10 + 3, yellow)
drawfilloval (xp (2), yp (2), 10, 10, red)
end if
put life
View.Update
if xp (1) = - 10 then
xp (1) := CXB - 100
end if
if xp (2) = - 10 then
xp (2) := CXB - 100
end if
end loop
end ParticleGenerationBlaster
setscreen ("graphics:640;480,nocursor")
for x1 : 1 .. 640 by 20
for y1 : 1 .. 480 by 20
drawbox (x1, y1, x1 + 20, y1 + 20, black)
end for
drawfillbox (0, 0, maxx, maxy, black)
end for
var arials, arialb, c : int
c := 66
arials := Font.New ("Arial:26:bold")
arialb := Font.New ("Arial:30:bold")
assert arials > 0
assert arialb > 0
Font.Draw ("The Adventures of Scrap Boy", 50, maxy - 50, arialb, yellow)
Font.Free (arials )
loop
var x, y, button : int
mousewhere (x, y, button )
Font.Draw ("Play", 50, maxy - 150, arialb, c )
if button = 0 and x > 50 and x < 130 and y > 320 and y < 356 then
c := 94
elsif
button = 1 and x > 50 and x < 130 and y > 320 and y < 356 then
cls
% Assign Values to Scrap Boy's Right Shoe
CXBLSSBrightshoe := 20
CYBLSSBrightshoe := 0
CXTRSSrightshoe := 45
CYTRSSBrightshoe := 20
% Assign Values to Scrap Boy's Left Shoe
CXBLSSBleftshoe := 50
CYBLSSBleftshoe := 0
CXTRSSBleftshoe := 75
CYTRSSBleftshoe := 20
% Assign Values to Scrap Boy's Left Leg
CXBLSSBleftleg := 25
CYBLSSBleftleg := 20
CXTRSSBleftleg := 40
CYTRSSBleftleg := 24
% Assign Values to Scrap Boy's Right Leg
CXBLSSBrightleg := 55
CYBLSSBrightleg := 20
CXTRSSrightleg := 70
CYTRSSBrightleg := 24
% Assign Values to Scrap Boy's Body
CXBLSSBbody := 15
CYBLSSBbody := 25
CXTRSSBbody := 80
CYTRSSBbody := 65
% Assign Values to Scrap Boy's Fan
CXSBfan := 12
CYSBfan := 45
CXRSBfan := 5
CYRSBfan := 10
% Assign Values to Scrap Boy's Arm
CXSBarm := 60
CYSBarm := 55
CXRSBarm := 100
CYRSBarm := 65
% Assign Values to Scrap Boy's Head
CXBLSSBhead := 24
CYBLSSBhead := 60
CXTRSSBhead := 71
CYTRSSBhead := 90
% Assign Values to Scrap Boy's Left Eye
CXSBlefteye := (CXTRSSBhead - CXBLSSBhead ) - 10
CYSBlefteye := 75
CXRSBlefteye := 7
CYRSBlefteye := 7
% Assign Values to Scrap Boy's Right Eye
CXSBrighteye := (CXTRSSBhead - CXBLSSBhead ) + 10
CYSBrighteye := 75
CXRSBrighteye := 7
CYRSBrighteye := 7
% Assign Values to Life, Speed
life := 4
speed := 1
fork Grid
% Draw Landing Pad
drawfilloval (CXBLP, CYBLP, CXRSBbiglandingpad, CYRBLP, 25)
drawfilloval (CXSLP, CYSLP, CXRSLP, CYRSLP, 12)
% Draw Robot
drawfillbox (CXSBarm - 2, CYSBarm - 2, CXRSBarm + 2, CYRSBarm + 2, black)
drawfillbox (CXSBarm, CYSBarm, CXRSBarm, CYRSBarm, 122)
drawfillbox (CXBLSSBbody - 1, CYBLSSBbody - 1, CXTRSSBbody + 1, CYTRSSBbody + 1, black)
drawfillbox (CXBLSSBbody, CYBLSSBbody, CXTRSSBbody, CYTRSSBbody, 92)
drawfilloval (CXSBfan, CYSBfan, CXRSBfan + 2, CYRSBfan + 2, black)
drawfilloval (CXSBfan, CYSBfan, CXRSBfan, CYRSBfan, 13)
drawfillbox (CXBLSSBhead - 2, CYBLSSBhead - 2, CXTRSSBhead + 2, CYTRSSBhead + 2, black)
drawfillbox (CXBLSSBhead, CYBLSSBhead, CXTRSSBhead, CYTRSSBhead, 54)
drawfillbox (CXBLSSBleftleg, CYBLSSBleftleg, CXTRSSBleftleg, CYTRSSBleftleg, 81)
drawfillbox (CXBLSSBrightleg, CYBLSSBrightleg, CXTRSSrightleg, CYTRSSBrightleg, 81)
drawfillbox (CXBLSSBleftshoe - 1, CYBLSSBleftshoe - 1, CXTRSSBleftshoe + 1, CYTRSSBleftshoe + 1, black)
drawfillbox (CXBLSSBleftshoe, CYBLSSBleftshoe, CXTRSSBleftshoe, CYTRSSBleftshoe, 51)
drawfillbox (CXBLSSBrightshoe - 1, CYBLSSBrightshoe + - 1, CXTRSSrightshoe + 1, CYTRSSBrightshoe + 1, black)
drawfillbox (CXBLSSBrightshoe, CYBLSSBrightshoe, CXTRSSrightshoe, CYTRSSBrightshoe, 51)
drawfilloval (CXSBlefteye, CYSBlefteye, CXRSBlefteye, CYRSBlefteye, 12)
drawfilloval (CXSBrighteye, CYSBrighteye, CXRSBrighteye, CYRSBrighteye, 12)
drawfilloval (CXSBlefteye, CYSBlefteye, CXRSBlefteye - 3, CYRSBlefteye - 3, black)
drawfilloval (CXSBrighteye, CYSBrighteye, CXRSBrighteye - 3, CYRSBrighteye - 3, black)
drawfilloval (CXSBlefteye + 2, CYSBlefteye + 2, CXRSBlefteye - 5, CYRSBlefteye - 5, white)
drawfilloval (CXSBrighteye + 2, CYSBrighteye + 2, CXRSBrighteye - 5, CYRSBrighteye - 5, white)
/*% Draw Evil Spikeria
drawfilloval (CXESbody, CYESbody, CXRESbody, CYRESbody, red)
drawline (CX1ESspiketopleft, CX2ESspiketopleft, XY1ESspiketopleft, CY2spiketopleft, black)
drawline (CX1ESspiketopright, CX2ESspiketopright, XY1ESspiketopright, CY2spiketopright, black)
drawline (CX1ESspikebottomleft, CX2ESspikebottomleft, XY1ESspikebottomleft, CY2spikebottomleft, black)
drawline (CX1ESspikebottomright, CX2ESspikebottomright, XY1ESspikebottomright, CY2spikebottomright, black)
drawline (CX1ESspikeleftleft, CX2ESspikeleftleft, XY1ESspikeleftleft, CY2spikeleftleft, black)
drawline (CX1ESspikeleftright, CX2ESspikeleftright, XY1ESspikeleftright, CY2spikeleftright, black)
drawline (CX1ESspikerightleft, CX2ESspikerightleft, XY1ESspikerightleft, CY2spikerightleft, black)
drawline (CX1ESspikerightright, CX2ESspikerightright, XY1ESspikerightright, CY2spikerightright, black)*/
% Draw Portal
drawfillbox (CXBLSP, CYBLSP, CXTRSP, CYTRSP, blue)
% Draw Blaster
drawfilloval (CXB, CYB, CXRB, CYRB, 122)
%Draw Black Hole
drawfillbox (CXBLSBH - 10, CYBLSBH, CXTRSBH + 10, CYTRSBH + 10, purple)
drawfillbox (CXBLSBH, CYBLSBH, CXTRSBH, CYTRSBH, black)
%Movement for Scrap Boy
setscreen ("graphics:640;480,nocursor")
View.Set ("offscreenonly")
fork ParticleGenerationBlaster
loop
% Draw BG
drawfillbox (0, 0, maxx, maxy, gray)
% Draw Landing Pad
drawfilloval (CXBLP, CYBLP, CXRSBbiglandingpad, CYRBLP, 25)
drawfilloval (CXSLP, CYSLP, CXRSLP, CYRSLP, 12)
% Draw Portal
drawfillbox (CXBLSP, CYBLSP, CXTRSP, CYTRSP, blue)
% Draw Blaster
drawfilloval (CXB, CYB, CXRB, CYRB, 122)
%Draw Black Hole
drawfillbox (CXBLSBH - 10, CYBLSBH, CXTRSBH + 10, CYTRSBH + 10, purple)
drawfillbox (CXBLSBH, CYBLSBH, CXTRSBH, CYTRSBH, black)
getch (ch )
cls
if ord (ch ) = 32 then
fork ParticleGenerationScrapBoy
end if
% BackgroundColour
colourback (gray)
% Draw BG
drawfillbox (0, 0, maxx, maxy, gray)
% Draw Landing Pad
drawfilloval (CXBLP, CYBLP, CXRSBbiglandingpad, CYRBLP, 25)
drawfilloval (CXSLP, CYSLP, CXRSLP, CYRSLP, 12)
% Draw Robot
drawfillbox (CXSBarm - 2, CYSBarm - 2, CXRSBarm + 2, CYRSBarm + 2, black)
drawfillbox (CXSBarm, CYSBarm, CXRSBarm, CYRSBarm, 122)
drawfillbox (CXBLSSBbody - 1, CYBLSSBbody - 1, CXTRSSBbody + 1, CYTRSSBbody + 1, black)
drawfillbox (CXBLSSBbody, CYBLSSBbody, CXTRSSBbody, CYTRSSBbody, 92)
drawfilloval (CXSBfan, CYSBfan, CXRSBfan + 2, CYRSBfan + 2, black)
drawfilloval (CXSBfan, CYSBfan, CXRSBfan, CYRSBfan, 13)
drawfillbox (CXBLSSBhead - 2, CYBLSSBhead - 2, CXTRSSBhead + 2, CYTRSSBhead + 2, black)
drawfillbox (CXBLSSBhead, CYBLSSBhead, CXTRSSBhead, CYTRSSBhead, 54)
drawfillbox (CXBLSSBleftleg, CYBLSSBleftleg, CXTRSSBleftleg, CYTRSSBleftleg, 81)
drawfillbox (CXBLSSBrightleg, CYBLSSBrightleg, CXTRSSrightleg, CYTRSSBrightleg, 81)
drawfillbox (CXBLSSBleftshoe - 1, CYBLSSBleftshoe - 1, CXTRSSBleftshoe + 1, CYTRSSBleftshoe + 1, black)
drawfillbox (CXBLSSBleftshoe, CYBLSSBleftshoe, CXTRSSBleftshoe, CYTRSSBleftshoe, 51)
drawfillbox (CXBLSSBrightshoe - 1, CYBLSSBrightshoe + - 1, CXTRSSrightshoe + 1, CYTRSSBrightshoe + 1, black)
drawfillbox (CXBLSSBrightshoe, CYBLSSBrightshoe, CXTRSSrightshoe, CYTRSSBrightshoe, 51)
drawfilloval (CXSBlefteye, CYSBlefteye, CXRSBlefteye, CYRSBlefteye, 12)
drawfilloval (CXSBrighteye, CYSBrighteye, CXRSBrighteye, CYRSBrighteye, 12)
drawfilloval (CXSBlefteye, CYSBlefteye, CXRSBlefteye - 3, CYRSBlefteye - 3, black)
drawfilloval (CXSBrighteye, CYSBrighteye, CXRSBrighteye - 3, CYRSBrighteye - 3, black)
drawfilloval (CXSBlefteye + 2, CYSBlefteye + 2, CXRSBlefteye - 5, CYRSBlefteye - 5, white)
drawfilloval (CXSBrighteye + 2, CYSBrighteye + 2, CXRSBrighteye - 5, CYRSBrighteye - 5, white)
% Draw Portal
drawfillbox (CXBLSP, CYBLSP, CXTRSP, CYTRSP, blue)
% Draw Blaster
drawfilloval (CXB, CYB, CXRB, CYRB, 122)
%Draw Black Hole
drawfillbox (CXBLSBH - 10, CYBLSBH, CXTRSBH + 10, CYTRSBH + 10, purple)
drawfillbox (CXBLSBH, CYBLSBH, CXTRSBH, CYTRSBH, black)
% Exit Condition
exit when ord (ch ) = 27
% Movement Condition for Scrap Boy
case ord (ch ) of
label 200 :
CYSBarm := CYSBarm + 5
CYBLSSBbody := CYBLSSBbody + 5
CYSBfan := CYSBfan + 5
CYBLSSBhead := CYBLSSBhead + 5
CYBLSSBleftleg := CYBLSSBleftleg + 5
CYBLSSBrightleg := CYBLSSBrightleg + 5
CYBLSSBleftshoe := CYBLSSBleftshoe + 5
CYBLSSBrightshoe := CYBLSSBrightshoe + 5
CYSBlefteye := CYSBlefteye + 5
CYSBrighteye := CYSBrighteye + 5
CYRSBarm := CYRSBarm + 5
CYTRSSBbody := CYTRSSBbody + 5
CYTRSSBhead := CYTRSSBhead + 5
CYTRSSBleftleg := CYTRSSBleftleg + 5
CYTRSSBrightleg := CYTRSSBrightleg + 5
CYTRSSBleftshoe := CYTRSSBleftshoe + 5
CYTRSSBrightshoe := CYTRSSBrightshoe + 5
label 208 :
CYSBarm := CYSBarm - 5
CYBLSSBbody := CYBLSSBbody - 5
CYSBfan := CYSBfan - 5
CYBLSSBhead := CYBLSSBhead - 5
CYBLSSBleftleg := CYBLSSBleftleg - 5
CYBLSSBrightleg := CYBLSSBrightleg - 5
CYBLSSBleftshoe := CYBLSSBleftshoe - 5
CYBLSSBrightshoe := CYBLSSBrightshoe - 5
CYSBlefteye := CYSBlefteye - 5
CYSBrighteye := CYSBrighteye - 5
CYRSBarm := CYRSBarm - 5
CYTRSSBbody := CYTRSSBbody - 5
CYTRSSBhead := CYTRSSBhead - 5
CYTRSSBleftleg := CYTRSSBleftleg - 5
CYTRSSBrightleg := CYTRSSBrightleg - 5
CYTRSSBleftshoe := CYTRSSBleftshoe - 5
CYTRSSBrightshoe := CYTRSSBrightshoe - 5
label 203 :
CXSBarm := CXSBarm - 5
CXBLSSBbody := CXBLSSBbody - 5
CXSBfan := CXSBfan - 5
CXBLSSBhead := CXBLSSBhead - 5
CXBLSSBleftleg := CXBLSSBleftleg - 5
CXBLSSBrightleg := CXBLSSBrightleg - 5
CXBLSSBleftshoe := CXBLSSBleftshoe - 5
CXBLSSBrightshoe := CXBLSSBrightshoe - 5
CXSBlefteye := CXSBlefteye - 5
CXSBrighteye := CXSBrighteye - 5
CXRSBarm := CXRSBarm - 5
CXTRSSBbody := CXTRSSBbody - 5
CXTRSSBhead := CXTRSSBhead - 5
CXTRSSBleftleg := CXTRSSBleftleg - 5
CXTRSSrightleg := CXTRSSrightleg - 5
CXTRSSBleftshoe := CXTRSSBleftshoe - 5
CXTRSSrightshoe := CXTRSSrightshoe - 5
label 205 :
CXSBarm := CXSBarm + 5
CXBLSSBbody := CXBLSSBbody + 5
CXSBfan := CXSBfan + 5
CXBLSSBhead := CXBLSSBhead + 5
CXBLSSBleftleg := CXBLSSBleftleg + 5
CXBLSSBrightleg := CXBLSSBrightleg + 5
CXBLSSBleftshoe := CXBLSSBleftshoe + 5
CXBLSSBrightshoe := CXBLSSBrightshoe + 5
CXSBlefteye := CXSBlefteye + 5
CXSBrighteye := CXSBrighteye + 5
CXRSBarm := CXRSBarm + 5
CXTRSSBbody := CXTRSSBbody + 5
CXTRSSBhead := CXTRSSBhead + 5
CXTRSSBleftleg := CXTRSSBleftleg + 5
CXTRSSrightleg := CXTRSSrightleg + 5
CXTRSSBleftshoe := CXTRSSBleftshoe + 5
CXTRSSrightshoe := CXTRSSrightshoe + 5
label :
CYSBarm := CYSBarm * 1
end case
drawfillbox (CXSBarm - 2, CYSBarm - 2, CXRSBarm + 2, CYRSBarm + 2, black)
drawfillbox (CXSBarm, CYSBarm, CXRSBarm, CYRSBarm, 122)
drawfillbox (CXBLSSBbody - 1, CYBLSSBbody - 1, CXTRSSBbody + 1, CYTRSSBbody + 1, black)
drawfillbox (CXBLSSBbody, CYBLSSBbody, CXTRSSBbody, CYTRSSBbody, 92)
drawfilloval (CXSBfan, CYSBfan, CXRSBfan + 2, CYRSBfan + 2, black)
drawfilloval (CXSBfan, CYSBfan, CXRSBfan, CYRSBfan, 13)
drawfillbox (CXBLSSBhead - 2, CYBLSSBhead - 2, CXTRSSBhead + 2, CYTRSSBhead + 2, black)
drawfillbox (CXBLSSBhead, CYBLSSBhead, CXTRSSBhead, CYTRSSBhead, 54)
drawfillbox (CXBLSSBleftleg, CYBLSSBleftleg, CXTRSSBleftleg, CYTRSSBleftleg, 81)
drawfillbox (CXBLSSBrightleg, CYBLSSBrightleg, CXTRSSrightleg, CYTRSSBrightleg, 81)
drawfillbox (CXBLSSBleftshoe - 1, CYBLSSBleftshoe - 1, CXTRSSBleftshoe + 1, CYTRSSBleftshoe + 1, black)
drawfillbox (CXBLSSBleftshoe, CYBLSSBleftshoe, CXTRSSBleftshoe, CYTRSSBleftshoe, 51)
drawfillbox (CXBLSSBrightshoe - 1, CYBLSSBrightshoe + - 1, CXTRSSrightshoe + 1, CYTRSSBrightshoe + 1, black)
drawfillbox (CXBLSSBrightshoe, CYBLSSBrightshoe, CXTRSSrightshoe, CYTRSSBrightshoe, 51)
drawfilloval (CXSBlefteye, CYSBlefteye, CXRSBlefteye, CYRSBlefteye, 12)
drawfilloval (CXSBrighteye, CYSBrighteye, CXRSBrighteye, CYRSBrighteye, 12)
drawfilloval (CXSBlefteye, CYSBlefteye, CXRSBlefteye - 3, CYRSBlefteye - 3, black)
drawfilloval (CXSBrighteye, CYSBrighteye, CXRSBrighteye - 3, CYRSBrighteye - 3, black)
drawfilloval (CXSBlefteye + 2, CYSBlefteye + 2, CXRSBlefteye - 5, CYRSBlefteye - 5, white)
drawfilloval (CXSBrighteye + 2, CYSBrighteye + 2, CXRSBrighteye - 5, CYRSBrighteye - 5, white)
put life
View.Update
delay (10)
%Colission with Border
if CXRSBarm >= maxx and CXSBarm <= 0 and CYRSBarm >= maxy and CYSBarm <= 0 then
life := life - 1
elsif CXTRSSBbody >= maxx and CXBLSSBbody <= 0 and CYBLSSBbody >= maxy and CYTRSSBbody <= 0 then
life := life - 1
elsif CXTRSSBhead >= maxx and CXBLSSBhead <= 0 and CYBLSSBhead >= maxy and CYTRSSBhead <= 0 then
life := life - 1
elsif CXTRSSBleftleg >= maxx and CXBLSSBleftleg <= 0 and CYBLSSBleftleg >= maxy and CYTRSSBleftleg <= 0 then
life := life - 1
elsif CXTRSSrightleg >= maxx and CXBLSSBrightleg <= 0 and CYBLSSBrightleg >= maxy and CYTRSSBrightleg <= 0 then
life := life - 1
elsif CXTRSSBleftshoe >= maxx and CXBLSSBleftshoe <= 0 and CYBLSSBleftshoe >= maxy and CYTRSSBleftshoe <= 0 then
life := life - 1
elsif CXTRSSrightshoe >= maxx and CXBLSSBrightshoe <= 0 and CYBLSSBrightshoe >= maxy and CYTRSSBrightshoe <= 0 then
life := life - 1
end if
% Colission with Portal
if CXRSBarm >= CXBLSBH and CXSBarm <= CXTRSBH and CYRSBarm >= CYBLSBH and CYSBarm <= CYTRSBH then
life := life - 1
elsif CXTRSSBbody >= CXBLSBH and CXBLSSBbody <= CXTRSBH and CYBLSSBbody >= CYBLSBH and CYTRSSBbody <= CYTRSBH then
life := life - 1
elsif CXTRSSBhead >= CXBLSBH and CXBLSSBhead <= CXTRSBH and CYBLSSBhead >= CYBLSBH and CYTRSSBhead <= CYTRSBH then
life := life - 1
elsif CXTRSSBleftleg >= CXBLSBH and CXBLSSBleftleg <= CXTRSBH and CYBLSSBleftleg >= CYBLSBH and CYTRSSBleftleg <= CYTRSBH then
life := life - 1
elsif CXTRSSrightleg >= CXBLSBH and CXBLSSBrightleg <= CXTRSBH and CYBLSSBrightleg >= CYBLSBH and CYTRSSBrightleg <= CYTRSBH then
life := life - 1
elsif CXTRSSBleftshoe >= CXBLSBH and CXBLSSBleftshoe <= CXTRSBH and CYBLSSBleftshoe >= CYBLSBH and CYTRSSBleftshoe <= CYTRSBH then
life := life - 1
elsif CXTRSSrightshoe >= CXBLSBH and CXBLSSBrightshoe <= CXTRSBH and CYBLSSBrightshoe >= CYBLSBH and CYTRSSBrightshoe <= CYTRSBH then
life := life - 1
/*elsif x2 >= CXBLSBH and x1 <= CXTRSBH and y2 >= CYBLSBH and y1 <= CYTRSBH then
life := life - 1
elsif x2 >= CXBLSBH and x1 <= CXTRSBH and y2 >= CYBLSBH and y1 <= CYTRSBH then
life := life - 1
elsif x2 >= CXBLSBH and x1 <= CXTRSBH and y2 >= CYBLSBH and y1 <= CYTRSBH then
life := life - 1*/
end if
end loop
var r, axle : int
var h, k, x1 : real
var xchange : int := 20
const pi := 22 / 7
r := 640
k := 18
x1 := r
axle := 300
loop
x1 := x1 + xchange
if x = 200 then
xchange := xchange * - 1
end if
if x = 0 then
xchange := xchange * - 1
end if
h := r * cos (k * x1 ) + axle
drawfilloval (round (x1 ), round (h ), 25, 25, black)
put h
%View.Update
delay (100)
cls
end loop
else
c := 66
end if
end loop
|
Please specify what version of Turing you are using
Turing 4.1 |