Need help with my 1st simple game
Posted: Tue Aug 28, 2018 12:59 am
Hello lovers!
After years of getting into coding for a week....realising I didn't know enough to make Zelda. Getting frustrated and quitting for months. Changing from c# to python and back. Visual studio, unity and game maker studio. I finally know what's made me fail so often. The plight of setting dreams beyond my current capabilities.
I've started from square one...learning basic coding concepts that apply to all languages. Simple calculations etc. And I've worked my way up to settling on Lua and am loving it (pun slightly intended.)
I've built a little code that moves 2 joined squares every time variable and change direction when a key is pressed (wasd) the issue I'm having is I'm trying to emulate snake movement.
Now I've just been running an x1 = x1 + 10 or - 10 for each movement period in love.update. the issue I'm having is I can't get the tail square to go where the head square was. They just move as a 10 × 20 pixel rectangle. I'm trying to figure out how to remedy this in my own before I move on to learning collision detection for snake food pickups.
I find that I learn best by figuring the bulk out on my own without direct code in front if me, otherwise I just get lazy and copy code without understanding it. So I just need help with the concept. I'm thinking what I need to do is create a table that holds the x, y coords of each square And cycling the coords down the table index (the idea being a table can be added to later when the snake eats food) but is this the easiest way to do what I'm trying to achieve?
Also what concept do I need to understand to get the coords to trail down the table?
This is my 1st post on any game dev forum so sorry it's long. I've been lurking your forums and you're all very friendly/knowledgable/helpful so thank you in advance for
a) reading this far and
b) any insight you can offer
and sorry for the rant!
Gypsy
After years of getting into coding for a week....realising I didn't know enough to make Zelda. Getting frustrated and quitting for months. Changing from c# to python and back. Visual studio, unity and game maker studio. I finally know what's made me fail so often. The plight of setting dreams beyond my current capabilities.
I've started from square one...learning basic coding concepts that apply to all languages. Simple calculations etc. And I've worked my way up to settling on Lua and am loving it (pun slightly intended.)
I've built a little code that moves 2 joined squares every time variable and change direction when a key is pressed (wasd) the issue I'm having is I'm trying to emulate snake movement.
Now I've just been running an x1 = x1 + 10 or - 10 for each movement period in love.update. the issue I'm having is I can't get the tail square to go where the head square was. They just move as a 10 × 20 pixel rectangle. I'm trying to figure out how to remedy this in my own before I move on to learning collision detection for snake food pickups.
I find that I learn best by figuring the bulk out on my own without direct code in front if me, otherwise I just get lazy and copy code without understanding it. So I just need help with the concept. I'm thinking what I need to do is create a table that holds the x, y coords of each square And cycling the coords down the table index (the idea being a table can be added to later when the snake eats food) but is this the easiest way to do what I'm trying to achieve?
Also what concept do I need to understand to get the coords to trail down the table?
This is my 1st post on any game dev forum so sorry it's long. I've been lurking your forums and you're all very friendly/knowledgable/helpful so thank you in advance for
a) reading this far and
b) any insight you can offer
and sorry for the rant!
Gypsy