For those who can't make the snake move, it's because the sub bindKeys isn't called when you start the game You can fix this by adding the sub bindKeys on the sub StartGame, and create a new button to assign the sub freeKeys so you can unbind the arrow keys
Hi. I'm a brazilian vba programmer who just started teaching how to use OpenGL with Excel VBA.I think your game will be much better with better graphics
Hey the only problem is that the snake doesn't move ive done it all the only difference it that the I changes to i and i dont think that that is the problem.Can you help me please?
Yes, you can move the snake with the arrows in the keyboard. That's all explained in the video, we use the Application.OnKey method to link each of the arrows to the move in each direction.
The yellow line highlights an error in the code. You can learn about errors and debugging in this video in the tutorial for beginners: th-cam.com/video/Rg-gXg8MYKc/w-d-xo.htmlsi=DRd51mkqIzTFecOJ
You may have added 2 procedures with the same name? Maybe is BindKeys and FreeKeys, check that out. You can also download the file from the blog: excelmacrofun.blogspot.com/2021/12/excel-snake-game.html
that's probably because you did not define the object variable, maybe miss-typed? It could also be the object is defined as something and you try to use a property/method that does not correspond to that object.
What's the error message? Make sure you declare r as dynamic array adding empty parenthesis: Dim r() As Integer It is also possible you forgot to redim when starting the game: ReDim r(4) Download the file to check the code in the blog article, that one works fine: excelmacrofun.blogspot.com/2021/12/excel-snake-game.html
@@GoGiNim Not sure what's the error you get... check the blog article and download the file there, that should work! excelmacrofun.blogspot.com/2021/12/excel-snake-game.html
I tested in Win 7 and Win 10, both with Excel 32 and 64 bit, but never tried Win 8. However, I do not think there is any reason it would not work there. Where exactly do you get the error?
Hi there, I have just seen your comments. First, the yellow "line" that you mention highlight the code causing a run-time error. Check this other video to understand what that is and learn how to debug your code: th-cam.com/video/Rg-gXg8MYKc/w-d-xo.html If the snake doesn't move, that's probably connected with the timer function. Please check this post to read more about it and download the file: excelmacrofun.blogspot.com/2021/12/excel-snake-game.html
Sounds like you forgot indeed to end some If statement. Download the file and have a look at the code to compare with yours. Here's the post: excelmacrofun.blogspot.com/2021/12/excel-snake-game.html
Yes, indeed I miss-typed "moveDown" in that line of code. Please be all aware of that, otherwise you won't be able to move the snake downwards. Not easy to talk and type guys, how you understand 🙂
Didn't realize it was that easy to make snake game in vba. Brilliant teaching btw, super clear explanation
Great... I'm learning VBA and English
For those who can't make the snake move, it's because the sub bindKeys isn't called when you start the game
You can fix this by adding the sub bindKeys on the sub StartGame, and create a new button to assign the sub freeKeys so you can unbind the arrow keys
Hi. I'm a brazilian vba programmer who just started teaching how to use OpenGL with Excel VBA.I think your game will be much better with better graphics
Hey the only problem is that the snake doesn't move ive done it all the only difference it that the I changes to i and i dont think that that is the problem.Can you help me please?
I alsoo ok tried it with the code named keys in your blog
Check the post and download the file there to see the code and compare with yours: excelmacrofun.blogspot.com/2021/12/excel-snake-game.html
did you press any botons to move the snake ?
Yes, you can move the snake with the arrows in the keyboard. That's all explained in the video, we use the Application.OnKey method to link each of the arrows to the move in each direction.
@@ExcelMacroMania thank 's
i have issue where when i clicked button Start game, my arrows do jackshit. please help
Amazing!!! Thank you 🙏🏼
Why do i have a yellow line word on the Sub ShowSnake () ?
The yellow line highlights an error in the code. You can learn about errors and debugging in this video in the tutorial for beginners: th-cam.com/video/Rg-gXg8MYKc/w-d-xo.htmlsi=DRd51mkqIzTFecOJ
It says compilation error: an ambiguous name has been detected: BindKeys. How do I solve it?
You may have added 2 procedures with the same name? Maybe is BindKeys and FreeKeys, check that out. You can also download the file from the blog: excelmacrofun.blogspot.com/2021/12/excel-snake-game.html
when pressing the start game button it say "object doesn't support this property or method"
that's probably because you did not define the object variable, maybe miss-typed? It could also be the object is defined as something and you try to use a property/method that does not correspond to that object.
How can i solve it?
help in the code tail =Ubound (r) it does not work
What's the error message? Make sure you declare r as dynamic array adding empty parenthesis:
Dim r() As Integer
It is also possible you forgot to redim when starting the game: ReDim r(4)
Download the file to check the code in the blog article, that one works fine:
excelmacrofun.blogspot.com/2021/12/excel-snake-game.html
4:23 I clicked it and it says "needs an array"
i made the same
@@GoGiNim Not sure what's the error you get... check the blog article and download the file there, that should work!
excelmacrofun.blogspot.com/2021/12/excel-snake-game.html
I faced encounter on timer module(I use window 8(bit 64)
I tested in Win 7 and Win 10, both with Excel 32 and 64 bit, but never tried Win 8. However, I do not think there is any reason it would not work there. Where exactly do you get the error?
Pls help me my snake doesn't move
Hi there, I have just seen your comments. First, the yellow "line" that you mention highlight the code causing a run-time error. Check this other video to understand what that is and learn how to debug your code: th-cam.com/video/Rg-gXg8MYKc/w-d-xo.html
If the snake doesn't move, that's probably connected with the timer function. Please check this post to read more about it and download the file:
excelmacrofun.blogspot.com/2021/12/excel-snake-game.html
I get an error that I need to put End If and my snake does not move
Sounds like you forgot indeed to end some If statement. Download the file and have a look at the code to compare with yours. Here's the post: excelmacrofun.blogspot.com/2021/12/excel-snake-game.html
Thank you
Awesome
I have no error encounter
hey the snake does not move and I did the same
Download the file and check the code to see if you are missing something here: excelmacrofun.blogspot.com/2021/12/excel-snake-game.html
Ok
main reason why many people are making mistake is , this teacher also made mistake ,
on 5:48 . i hope he will see and correct it
Yes, indeed I miss-typed "moveDown" in that line of code. Please be all aware of that, otherwise you won't be able to move the snake downwards. Not easy to talk and type guys, how you understand 🙂
I'm done! But why so the snake don't move?
o
snake doesn't move😭
Try using the exact same code as in the file for download here: excelmacrofun.blogspot.com/2021/12/excel-snake-game.html