Click here to Skip to main content
15,880,796 members
Home / Discussions / C#
   

C#

 
QuestionThe file version maintain utility Pin
sahani from india12-Feb-14 1:56
sahani from india12-Feb-14 1:56 
AnswerRe: The file version maintain utility Pin
Pete O'Hanlon12-Feb-14 2:16
mvePete O'Hanlon12-Feb-14 2:16 
GeneralRe: The file version maintain utility Pin
OriginalGriff14-Feb-14 22:27
mveOriginalGriff14-Feb-14 22:27 
QuestionHelp needed XNA and Window Forms Pin
larsp77712-Feb-14 0:57
larsp77712-Feb-14 0:57 
AnswerRe: Help needed XNA and Window Forms Pin
DaveyM6912-Feb-14 1:09
professionalDaveyM6912-Feb-14 1:09 
GeneralRe: Help needed XNA and Window Forms Pin
larsp77712-Feb-14 1:13
larsp77712-Feb-14 1:13 
GeneralRe: Help needed XNA and Window Forms Pin
DaveyM6912-Feb-14 1:39
professionalDaveyM6912-Feb-14 1:39 
GeneralRe: Help needed XNA and Window Forms Pin
larsp77712-Feb-14 4:34
larsp77712-Feb-14 4:34 
Thanks, it starting to be clear but it isn´t all that simple to me... Smile | :)

So, suppose something happends in my XNA-game.

There is a update-method were I check if the enemy is alive and within range of Another object:

C#
if (!(enemy.IsAlive && (player.X <= enemy.X + 100) && (player.Y <= enemy.Y + 50 || player.Y >= enemy.Y + 50))) 
               isActivated = false;

if (enemy.IsAlive && (player.X <= enemy.X + 100) && (player.Y <= enemy.Y + 50 || player.Y >= enemy.Y + 50))            {
                             
if ((depthChargeX >= enemyX - 50 && depthChargeX <= enemyX + 50) || (depthChargeY >= enemyY - 50 && depthChargeY <= enemyY + 50) && isActivated == true)
                { 
                        enemy.IsAlive = false;
                        hit.Play();
                        wreck2.IsAlive = true;
                        
                        wreck2.Update(gameTime);
                       
                }
            }


If it isn´t in range I want to send a bool or something to my form so I can e.g. enable or disable a button.

Would I then send that bool to the OnGameEvent or must I create a new class like in one in one of the examples. I am a little confused still I must admit.

But I suppose the HandleGameEvent in the form listens to the event raised.

And

C#
game.GameEvent += HandleGameEvent; 


Is where you subscribe to the event raised by the game.

I also get: The name 'HandleGameEvent' does not exist in the current context but I suppose something is missing.
GeneralRe: Help needed XNA and Window Forms Pin
Pete O'Hanlon12-Feb-14 4:50
mvePete O'Hanlon12-Feb-14 4:50 
AnswerRe: Help needed XNA and Window Forms Pin
Marco Bertschi12-Feb-14 1:40
protectorMarco Bertschi12-Feb-14 1:40 
QuestionRegEx problem with Escape sequences Pin
Marco Bertschi11-Feb-14 23:30
protectorMarco Bertschi11-Feb-14 23:30 
SuggestionRe: RegEx problem with Escape sequences Pin
Kornfeld Eliyahu Peter11-Feb-14 23:39
professionalKornfeld Eliyahu Peter11-Feb-14 23:39 
GeneralRe: RegEx problem with Escape sequences Pin
Marco Bertschi11-Feb-14 23:53
protectorMarco Bertschi11-Feb-14 23:53 
GeneralRe: RegEx problem with Escape sequences Pin
Kornfeld Eliyahu Peter11-Feb-14 23:57
professionalKornfeld Eliyahu Peter11-Feb-14 23:57 
GeneralRe: RegEx problem with Escape sequences Pin
Marco Bertschi12-Feb-14 0:09
protectorMarco Bertschi12-Feb-14 0:09 
GeneralRe: RegEx problem with Escape sequences Pin
Kornfeld Eliyahu Peter12-Feb-14 0:25
professionalKornfeld Eliyahu Peter12-Feb-14 0:25 
GeneralRe: RegEx problem with Escape sequences Pin
Marco Bertschi12-Feb-14 1:06
protectorMarco Bertschi12-Feb-14 1:06 
GeneralRe: RegEx problem with Escape sequences Pin
Kornfeld Eliyahu Peter12-Feb-14 1:11
professionalKornfeld Eliyahu Peter12-Feb-14 1:11 
GeneralRe: RegEx problem with Escape sequences Pin
Marco Bertschi12-Feb-14 1:17
protectorMarco Bertschi12-Feb-14 1:17 
GeneralRe: RegEx problem with Escape sequences Pin
Kornfeld Eliyahu Peter12-Feb-14 1:25
professionalKornfeld Eliyahu Peter12-Feb-14 1:25 
GeneralRe: RegEx problem with Escape sequences Pin
Marco Bertschi12-Feb-14 1:39
protectorMarco Bertschi12-Feb-14 1:39 
GeneralRe: RegEx problem with Escape sequences Pin
Kornfeld Eliyahu Peter12-Feb-14 1:46
professionalKornfeld Eliyahu Peter12-Feb-14 1:46 
AnswerRe: RegEx problem with Escape sequences Pin
Kornfeld Eliyahu Peter12-Feb-14 10:13
professionalKornfeld Eliyahu Peter12-Feb-14 10:13 
GeneralRe: RegEx problem with Escape sequences Pin
Marco Bertschi12-Feb-14 21:11
protectorMarco Bertschi12-Feb-14 21:11 
GeneralRe: RegEx problem with Escape sequences Pin
Kornfeld Eliyahu Peter12-Feb-14 21:36
professionalKornfeld Eliyahu Peter12-Feb-14 21:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.