Need Help with animation (Beginner Coding)
Author |
Message |
saahel
|
Posted: Mon Dec 07, 2015 12:29 pm Post subject: Need Help with animation (Beginner Coding) |
|
|
Hi, i will just cut to the chase, i would like to know how to make a [/b]square go from right to left of the screen with very simple codes, thank you for your help guys!
this is what i got for now:
var y : int
for decreasing x : 640 .. 0
y := round (0 / 640 * x + 200)
drawfillbox (x, y, 42, 220, 1)
delay (10)
drawfillbox (x, y, 42, 220, 0)
end for |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Insectoid
![](http://compsci.ca/v3/uploads/user_avatars/13760332514cbd0ce972eaa.jpg)
|
Posted: Mon Dec 07, 2015 7:24 pm Post subject: RE:Need Help with animation (Beginner Coding) |
|
|
You're almost there. Remember that a box has two sets of x and y coordinates. If you only change one set, the box will stretch instead of move. |
|
|
|
|
![](images/spacer.gif) |
|
|