Animated Star isn't working
Author |
Message |
Grapefruit
|
Posted: Fri Jan 11, 2013 2:55 pm Post subject: Animated Star isn't working |
|
|
What is it you are trying to achieve?
I'm trying to get the star to change color (that part's working). I also want the circles around the star to move and for there to be more circles (so it looks more animated). I'm also trying to get the star to twirl around.
What is the problem you are having?
The animation with the circles around the stars doesn't work well. Also, when the star twirls, it isn't clearing the old star so it isn't working.
Describe what you have tried to solve this problem
I DONT KNOW HOW!
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Turing: |
%Star on Christmas tree
var starRand: int
var colorAroundStar: int:= 14
var colorAroundStar1: int
var starx1: int:= 1048
var stary1: int:= 233
var starx2: int:= 1067
var stary2: int:= 254
var star1x: int:= 1048
var star1y: int:= 233
var star2x: int:= 1067
var star2y: int:= 254
%star on top of tree
randint(starRand, 1, 15)
randint(colorAroundStar1, 1, 255)
if colorAroundStar1= 14 then
colorAroundStar:= 14
end if
if colorAroundStar1= 44 then
colorAroundStar:= 44
end if
if colorAroundStar1= 67 then
colorAroundStar:= 67
end if
if colorAroundStar1= 68 then
colorAroundStar:= 68
end if
if colorAroundStar1= 69 then
colorAroundStar:= 69
end if
if colorAroundStar1= 91 then
colorAroundStar:= 91
end if
if colorAroundStar1= 92 then
colorAroundStar:= 92
end if
if colorAroundStar1= 93 then
colorAroundStar:= 93
end if
drawfillstar(star1x,star1y,star2x,star2y,colorAroundStar )
if starRand= 2 then
starx1:=starx2
star1y:=stary2
star2x:=starx1
star2y:=stary1
end if
if starRand= 4 then
star1y:=stary1
star1x:=starx1
star2x:=starx2
star2y:=stary2
end if
if starRand> 0 and starRand< 7 then
%forth circle on star
drawoval(1058, 243, 20, 20,colorAroundStar )
%third circle on star
drawoval(1058, 243, 28, 28,colorAroundStar )
drawoval(1058, 243, 29, 29,colorAroundStar )
drawoval(1058, 243, 30, 30,colorAroundStar )
end if
|
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
Grapefruit
|
Posted: Fri Jan 11, 2013 2:57 pm Post subject: Re: Animated Star isn't working |
|
|
just to clarify, the entire program (other then declaring variables) is in a loop. Forgot to attach |
|
|
|
|
|
Tony
|
Posted: Fri Jan 11, 2013 4:11 pm Post subject: Re: Animated Star isn't working |
|
|
Grapefruit @ Fri Jan 11, 2013 2:55 pm wrote:
I DONT KNOW HOW!
If you already knew how to do everything, you wouldn't be taking this class, right?
You should probably post the code that you are having problems with (ideally the minimal example the demonstrates the problem).
Although although..
Turing: |
if colorAroundStar1=14 then
colorAroundStar:=14
end if
if colorAroundStar1=44 then
colorAroundStar:=44
end if
|
what does this piece of code do? |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
|
|