Click here to Skip to main content
14,743,536 members
Home » Discussions » C#
   

C#

 
QuestionIF Else statement on background colour of label. Pin
Member 1497767230-Oct-20 3:29
MemberMember 1497767230-Oct-20 3:29 
SuggestionRe: IF Else statement on background colour of label. Pin
Richard MacCutchan30-Oct-20 3:36
mveRichard MacCutchan30-Oct-20 3:36 
GeneralRe: IF Else statement on background colour of label. Pin
Member 1497767230-Oct-20 3:47
MemberMember 1497767230-Oct-20 3:47 
GeneralRe: IF Else statement on background colour of label. Pin
OriginalGriff30-Oct-20 3:52
mveOriginalGriff30-Oct-20 3:52 
AnswerRe: IF Else statement on background colour of label. Pin
OriginalGriff30-Oct-20 3:50
mveOriginalGriff30-Oct-20 3:50 
GeneralRe: IF Else statement on background colour of label. Pin
Member 1497767230-Oct-20 4:01
MemberMember 1497767230-Oct-20 4:01 
QuestionAdd treasure to my maze game Pin
Member 1497767229-Oct-20 5:10
MemberMember 1497767229-Oct-20 5:10 
AnswerRe: Add treasure to my maze game Pin
OriginalGriff29-Oct-20 5:20
mveOriginalGriff29-Oct-20 5:20 
We can't really help you with any specifics: we have no idea how your code works - and I for one don't want to wade through a pile of code trying to work out what part does what and why!

The way I'd do it is different: I wouldn't close the form and reopen a new one, I'd reuse the current form by clearing the play area and loading a new one from a file, using the same method I used when I first loaded a form - it's a lot more flexible that way than by designing a "static form" as a maze each time!

Having said that, I'd have a GameObject abstract base class, and derive Wall, Door, Player, Monster, Treasure, and ExitLevel classes from that. Your game board then becomes an array of GameObject instances, and the base class ensures that the derived classes have Move, Open, Attack, and so forth methods which they can handle. The Wall and Door classes for example refuse to move in any direction, but the Player can move provided nothing blocks his way. Doors and Chests can Open, Monsters can Attack and be Attacked and so forth.

How does yours work? Please, don't say "a button for each space on the board" because I'll get quite depressed ... Laugh | :laugh:
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!

AnswerRe: Add treasure to my maze game Pin
Gerry Schmitz29-Oct-20 6:14
mveGerry Schmitz29-Oct-20 6:14 
QuestionIs it possible to save DataGridView contents to a file with a specific suffix which can be loaded just by my own application? Pin
Alex Dunlop28-Oct-20 9:09
MemberAlex Dunlop28-Oct-20 9:09 
AnswerRe: Is it possible to save DataGridView contents to a file with a specific suffix which can be loaded just by my own application? Pin
Dave Kreskowiak28-Oct-20 10:21
mveDave Kreskowiak28-Oct-20 10:21 
AnswerRe: Is it possible to save DataGridView contents to a file with a specific suffix which can be loaded just by my own application? Pin
OriginalGriff28-Oct-20 10:27
mveOriginalGriff28-Oct-20 10:27 
AnswerRe: Is it possible to save DataGridView contents to a file with a specific suffix which can be loaded just by my own application? Pin
Gerry Schmitz28-Oct-20 19:31
mveGerry Schmitz28-Oct-20 19:31 
QuestionMouse enter to new form Pin
Member 1497767228-Oct-20 6:01
MemberMember 1497767228-Oct-20 6:01 
AnswerRe: Mouse enter to new form Pin
Richard MacCutchan28-Oct-20 6:44
mveRichard MacCutchan28-Oct-20 6:44 
GeneralRe: Mouse enter to new form Pin
Member 1497767228-Oct-20 6:46
MemberMember 1497767228-Oct-20 6:46 
GeneralRe: Mouse enter to new form Pin
OriginalGriff28-Oct-20 6:57
mveOriginalGriff28-Oct-20 6:57 
QuestionC# win forms .net core, user control, array on a dialog. Pin
jkirkerx27-Oct-20 14:43
professionaljkirkerx27-Oct-20 14:43 
AnswerRe: C# win forms .net core, user control, array on a dialog. Pin
Gerry Schmitz27-Oct-20 20:20
mveGerry Schmitz27-Oct-20 20:20 
AnswerRe: C# win forms .net core, user control, array on a dialog. Pin
BillWoodruff28-Oct-20 0:05
mveBillWoodruff28-Oct-20 0:05 
GeneralRe: C# win forms .net core, user control, array on a dialog. Pin
OriginalGriff28-Oct-20 1:03
mveOriginalGriff28-Oct-20 1:03 
GeneralRe: C# win forms .net core, user control, array on a dialog. Pin
jkirkerx28-Oct-20 5:32
professionaljkirkerx28-Oct-20 5:32 
GeneralRe: C# win forms .net core, user control, array on a dialog. Pin
OriginalGriff28-Oct-20 5:40
mveOriginalGriff28-Oct-20 5:40 
GeneralRe: C# win forms .net core, user control, array on a dialog. Pin
jkirkerx28-Oct-20 5:49
professionaljkirkerx28-Oct-20 5:49 
GeneralRe: C# win forms .net core, user control, array on a dialog. Pin
OriginalGriff28-Oct-20 6:20
mveOriginalGriff28-Oct-20 6:20 

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.