slowly building a boss rush.

Show off your games, demos and other (playable) creations.
Post Reply
User avatar
sanjiv
Citizen
Posts: 88
Joined: Mon Feb 27, 2012 5:11 am

slowly building a boss rush.

Post by sanjiv »

MegaMan based. Basically, two figures going mano-a-mano in a room. I guess I've spent a lot of time learning small stuff, but this is my first attempt to put together a comprehensive package. I'll update it as I go. The biggest challenge for me is figuring out how to structure my files and programs.

My first goal is to get animation running, so I've abandoned collision detection with structures in favor of just a basic x=math.max(x1,math.min(x2,x)) sort of deal.

And ACTUALLY, here's a problem I'm having with sprites v2: When I try and move the contents of love.update(dt) into a separate function of its own, and then call on it, it doesn't seem to work, and I don't know why. Essentially, I want to move that chunk from main.lua into drawSprite.lua.
Attachments
sprites v2.love
(6.52 KiB) Downloaded 140 times
boss simple.love
(24.19 KiB) Downloaded 303 times
User avatar
Ragzouken
Citizen
Posts: 84
Joined: Fri Aug 10, 2012 7:59 am
Contact:

Re: slowly building a boss rush.

Post by Ragzouken »

The reason your code doesn't work in a function is because you are trying to set the global variable "frame" in the function, but the function creates a local variable "frame" as part of the input arguments - this means when you set "frame" in the body of the function it's actually just setting the local variable that's discarded when the function returns. You'll need to rename one of the variables so they don't clash, or perhaps move frame to be part of the "animate" table.
Post Reply

Who is online

Users browsing this forum: glitchapp and 49 guests