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
Steve Tsiki
NA
42
0
Draw object from List
Mar 8 2011 6:05 AM
Hello to everybody.
I'm facing a problem in my code. I have created a class called Obstacles and in my main code I created this function:
public void o_value(Object o, EventArgs e) // Function to change bool and insert Object Obtacle
{
obstacle_pressed = true;
obstacles.Add(new Obstacle(new Rectangle(300, 300, 30, 60),Content.Load<Texture2D>("Obstacles/default")));
}
Then in my Draw function I do as followed:
if (obstacle_pressed == true)
{
foreach (Obstacle obstacle in obstacles)
{
obstacle.Draw(spriteBatch); // I have created a function Draw in Obstacles Class
}
}
But nothing is shown in my Game!
Could anyone please help?
Thanks
Reply
Answers (
9
)
Export to excel
Microsoft Kinect Sets Guinness World Records