|
Post by Admin on Feb 13, 2014 21:15:11 GMT
A new Video Tutorial "Create a Snake game with C#" has been uploaded. Watch it here.
|
|
|
Post by bob on Apr 26, 2014 18:10:20 GMT
gameTimer.Tick += UpdateScreen(); --> this method is not overloaded, but it needs to be. How can I solve this problem?
|
|
|
Post by Admin on Apr 28, 2014 9:16:10 GMT
gameTimer.Tick += UpdateScreen(); --> this method is not overloaded, but it needs to be. How can I solve this problem? Hi Bob You can overload methods by having 2 or more methods with the same name but with different signatures. These methods will be recognized by the compiler as seperate methods. For example: private void Foo()
private void Foo()
These methods are the same and will generate an error. private void Foo()
private void Foo(int x)
private void Foo(int x, int y)
These methods are not the same and will generate no errors. Call either method by providing the correct amount of input parameters See this link for more information on overloading: csharpindepth.com/Articles/General/Overloading.aspx
|
|
|
Post by Roman on Jun 26, 2014 19:55:41 GMT
the same problem but not because of overloading. My VS just doesn't see this method at all.
|
|
|
Post by Mahmoud on Dec 9, 2014 14:49:41 GMT
Hello Michiel,
I am new to c# so excuse my question if it seems a little dumb. in form1> line 58. how could you construct the list "food" as new circle instance. shouldn't you be using the add keyword to add new object to food list. Thank you for reply.
Keep the good work!
|
|
|
Post by Justin on Jan 23, 2015 20:48:23 GMT
I understand how to overload the method, but gameTimer.Tick += is using a call without parameters... I don't understand how that is supposed to work. (Very new to this)
|
|
|
Post by Justin on Jan 23, 2015 21:19:07 GMT
I was able to Google a solution:
Instead of using this line of code, which gives the overload error Bob mentioned: gameTimer.Tick += UpdateScreen();
I am using this line of code and it works: gameTimer.Tick += new EventHandler(UpdateScreen);
|
|
|
Post by Max on Feb 2, 2015 15:58:52 GMT
Hello ! the links u provided is not working ! and if u do not mind please what recoding software used in ur tutorials the coffeeshope and the Garage projects !
I also have some other questions please if u do not mind !
|
|
|
Post by Alex Wazovski on Mar 17, 2015 10:56:09 GMT
How can I solve this problem ? Please help me !
|
|
|
Post by matthew on Jun 12, 2015 15:33:43 GMT
hi sorry about the very stupid reply but when you use the word Snake for example Snake.Add(head); where do you get this definition for snake from?
|
|
|
Post by Ahmad Zahid on Aug 4, 2015 22:26:29 GMT
hi i understand that all but i can know the logic of the game plz help me to know the logic of that snake game,that how snake move and how it curve etc???
|
|
|
Post by Elvis on Apr 12, 2016 18:20:39 GMT
Nice tutorial, would someone be willing to comment out the code to get an idea what all the functions are?
|
|
|
Post by Tomasz on May 27, 2017 11:16:51 GMT
Hi, Could You tell how can I add a simple delegate to this game? I'll be grateful for answer.
Thank You
|
|
|
Post by mayank on Jul 16, 2017 13:49:21 GMT
can we add a triangle at the tail of the snake and if it is possible can you please asssit me in that
|
|
|
Post by bibek on Apr 2, 2018 2:27:37 GMT
keys datatype is not recognized. what should i do?
|
|