C# Error :(

10/03/2012 20:29 iU0U2bm9E1Gir7gf#1
This account has been archived
10/03/2012 20:43 nkkk#2
Code:
        Game1 game = new Game1();
seems like an error to me, to you really want to create a new instance of, "Game1" in your Damage class, normaly there is only 1 instance of the Game class in total.
note that in
Code:
Damage Damage = new Damage();
always "Game1 game = new Game1();" is executet first.
10/03/2012 20:45 iU0U2bm9E1Gir7gf#3
This account has been archived
10/03/2012 20:54 nkkk#4
hmm you can write:
Code:
        Game1 game;
instead of
Code:
        Game1 game = new Game1();
and then make a constructor
Code:
public Damage(Game1 game)
{
this.game = game;
}
und dann übergibst du eben das game objekt im konstruktor.
10/03/2012 21:36 GodHacker#5
Quote:
Originally Posted by nkkk View Post
hmm you can write:
Code:
        Game1 game;
instead of
Code:
        Game1 game = new Game1();
and then make a constructor
Code:
public Damage(Game1 game)
{
this.game = game;
}
und dann übergibst du eben das game objekt im konstruktor.
Warum schreibst du erst auf English und dann auf Deutsch? ^^