Implementing levels
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Implementing levels
heres what my game is so far
- Attachments
-
- UntitledGame.love.zip
- (4.9 MiB) Downloaded 160 times
Re: Implementing levels
One thing at a time. I've edited main.lua so there's a concept of being a "current level" among a "list of levels", and there's a way to start a new level.
I also made some smaller edits, like rearrange the order that things happens in in love.update() (first react to input, then update physics, and finally update the camera's position) which will fix the one-frame delay for things.
I hope it helps a bit.
I also made some smaller edits, like rearrange the order that things happens in in love.update() (first react to input, then update physics, and finally update the camera's position) which will fix the one-frame delay for things.
I hope it helps a bit.
- Attachments
-
- UntitledGame.love
- (4.83 MiB) Downloaded 154 times
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
"If each mistake being made is a new one, then progress is being made."
Re: Implementing levels
Thank you! That was very helpful, however I have 1 question, for the EndRectangle function, if I was to have a level 3,4,5... so on would i need to change the name of the EndRectangle function? or how would that work for other levels?
Re: Implementing levels
Also i please ask that no one steal my game (not directed towards anyone, just a blanket statement)
Re: Implementing levels
EndRectangle function? Do you mean the endRectangle table? Right now every level has its own endRectangle table. There's an assumption in the code that every level only has one exit (you could make 'endRectangle' into an array just like 'platforms' and 'dangerZones' to get multiple exits), and that the exit always leads to the next level (currentLevelIndex tells us what the current level is, so currentLevelIndex+1 is the next level).
(Also, don't worry about anyone "stealing" your game. It's not in anyone's interest.)
(Also, don't worry about anyone "stealing" your game. It's not in anyone's interest.)
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
"If each mistake being made is a new one, then progress is being made."
Re: Implementing levels
Thank you!
(this is my first time on a coding forum sorry lol)
(this is my first time on a coding forum sorry lol)
Re: Implementing levels
Ok so, I got down the levels, now i need to do the save data and the level page, which i still dont know how to do.
Who is online
Users browsing this forum: Ahrefs [Bot], Semrush [Bot] and 5 guests