TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
albert albert
NA
524
0
Moving stars
Apr 20 2011 4:12 AM
Hi,
I just want to move the stars from up to down.
This is my method.
If I put breakpoint on speed I see a number of speed. But the stars doesnt move.
[code]
public void StarsSpeed(Rectangle boundaries)
{
Point randomPointh;
Star newStar;
int randomX = random.Next(boundaries.Left,boundaries.Width);
int randomY = random.Next(boundaries.Top,boundaries.Height);
randomPointh = new Point(randomX, randomY);
int starsSpeed = 10;
int height = boundaries.Height;
int starsNumbersSpeed = starList.Count;
for (int i = 0; i < starList.Count; i++)
{
var star = starList.Count;
//Star star = RandomStar(boundaries);
speed = (float)random.NextDouble() * 10 + 2;
//starList.Add(star);
if ((randomPointh.Y += (int)speed) > height)
{
//Move(Direction.Down); //(float)random.NextDouble() * 10 + 2;
//Location.Y += GameConstants.speedStar;
// speed = GameConstants.speedStar;
//speed += GameConstants.speedStar;
Move(Direction.Down);
int colorIndex = random.Next(ColorsOfStar.Length);
Pen pen = ColorsOfStar[colorIndex];
newStar = new Star(randomPointh, pen);
//starList.Add(star);
}
}
}//End method
[/code]
THX
Attachment:
star.rar
Reply
Answers (
4
)
C# & .NET for Smartphone Apps?
Trying to understand how server and browser handles events