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
Removing image when hit
Apr 10 2011 9:43 AM
HI Everyone,
I want to remove image when it is hit.
I have 2 methods:
[code]
public void DrawLive(Graphics g)
{
for (int i = 0; i <= GameConstants.gameLives; i++)
{
Bitmap image = Properties.Resources.paxship_02;
Font drawFont = new Font("Arial", 14);
int scaledWidth = image.Width / 2;
int scaledHeight = image.Height / 2;
g.DrawImage(image, 1100 /*boundaries.Right - scaledWidth*/, 30f, scaledWidth, scaledHeight);
g.DrawImage(image, 1150 /*boundaries.Right - scaledWidth*/, 30f, scaledWidth, scaledHeight);
g.DrawImage(image, 1200 /*boundaries.Right - scaledWidth*/, 30f, scaledWidth, scaledHeight);
string livesString = lives.ToString() + " x ";
SizeF stringWidth = g.MeasureString(livesString, drawFont);
g.DrawString(livesString, drawFont, Brushes.Red, /*boundaries.Right - scaledWidth - stringWidth.Width*/1200, 5f); //top left
}
//g.DrawImage(image, 1100, 30);
// }
}
private bool UpdateLive()
{
bool LivesLeftNo = false;
//playerShip.Alive = false;
//Form1.Fm1.lbUpdateScore.Text = lives.ToString();
//lives = lives - 1;
//lives= GameConstants.gameLives - 1;
//DrawLive--;
if (lives == 0)
{
//GameOver(this, null);
//GameOverTime = DateTime.Now;
LivesLeftNo = true;
}
return LivesLeftNo;
}
[/code]
and this is the hole project.
THX.
Attachment:
starinvader2-09-04-2011-versie2.rar
Reply
Answers (
4
)
To fetch data in Datagridview Control
DateTime in db only shows date w/ time of zero