Box moving
| Author |
Message |
SK
|
Posted: Wed Apr 27, 2016 9:18 pm Post subject: Box moving |
|
|
What is it you are trying to achieve?
Trying to make a box move across the screen
What is the problem you are having?
It keeps on stretching... (making a snail)
Describe what you have tried to solve this problem
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
| Turing: |
var x: int:= 60
var y: int:= 110
var x2: int:= 40
var y2: int:= 100
var xradius: int:= 12
var yradius: int:= 12
var xradius1: int:= 90
var yradius1: int:= 85
var xchange:= 5
setscreen ("graphics: 640;480")
loop
drawfilloval (x, y, xradius,yradius, purple)
delay (50)
if x> 640
then
xchange:=- 5
elsif
x< 0 then
xchange:= 5
end if
drawfilloval (x,y,xradius,yradius, white)
x:=x+xchange
drawfillbox (x2, y2, xradius1, yradius1, green)
if x> 640
then
xchange:=- 5
elsif
x2< 0 then
xchange:= 5
end if
drawfillbox (x2,y2,xradius1,yradius1, white)
x2:=x2+xchange
end loop
|
Please specify what version of Turing you are using
<Answer Here> |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
Insectoid

|
Posted: Thu Apr 28, 2016 4:58 am Post subject: RE:Box moving |
|
|
| Look at the parameters of Draw.FillBox. Radius should not be one of them. |
|
|
|
|
 |
|
|