
P.S., did you miss my suggestion? I don't know if I made it clear that I'm pretty sure the game will be broken without that fix, it's not just the indentation I'm worried about.
I'm sorry, make thatWolfNinja2 wrote: EDIT: I tried the for loop you suggested, does not work, says expected userdata.
Code: Select all
for i = 1, P_bullets do
g.draw(B_pic, i*32, 26, math.rad(-90), 4, 4)
end
I saw it and took the advice of orginization, and WOW... I did the same mistake twice. D:< Tired mistake, the download will be fixed now.Puzzlem00n wrote:Uh, for me the new download still ends after the first level...![]()
P.S., did you miss my suggestion? I don't know if I made it clear that I'm pretty sure the game will be broken without that fix, it's not just the indentation I'm worried about.
Code: Select all
for i=1, 100 do
if i < 50 then
print("i is less than 50 and is currently equal to" .. i)
end
end
Code: Select all
for i=1,100 do
if i<50 then
print("i is less than 50 and is currently equal to"..i)
end
end
I always try to organize code like this. What Puzz was referencing was pretty much just me being a newb and forgetting end's after statements then making up for it by putting them at the bottom of the function. Thanks for the help thoughsubstitute541 wrote:Putting "ends" at random places until it gives no errors is a bad practice. Try using whitespaces in your code. Something like :Instead of :Code: Select all
for i=1, 100 do if i < 50 then print("i is less than 50 and is currently equal to" .. i) end end
Of course, it's up to the programmer if he wants different styles or not. I am just suggesting a cleaner, readable style. If you wanna learn more, there's a wikipedia page about programming styles.Code: Select all
for i=1,100 do if i<50 then print("i is less than 50 and is currently equal to"..i) end end
Code: Select all
function love.draw()
if secret == "OFF MOFO" then
bulletdraw()
if startstate == "starting" then
g.setFont(small)
g.print("Hello! Welcome To PlatformGuy!", 266, 220)
g.print("Controls Are: Arrow Keys,",266, 240)
g.print("Enter To Restart LvL,",266, 260)
g.print("Spacebar to shoot, (Try shooting Spikes!)",266,280)
g.print("S to change Skin!",266,300)
g.print("Press Enter To Start!",266,320)
elseif gamestate == "lvl 2" then
g.setColor(0,255,0,100)
g.print("Congratz to Nsmurf for finding the Waffles!",40,268)
elseif gamestate == "lvl 4" then
g.setColor(255,255,255,255)
g.draw(tile,768,320,0,2,2,0)
end
enemy_draw()
playerdraw()
mapdraw()
bullet_counter_draw()
g.setFont(small)
g.print("Deaths:" .. P_deaths, 300, 5)
secret_draw()
--DEBUGGING
--print( P_storedY ,5, 65)
--print( P_timer )
--print( P_storedY - player.y)
--print( player.x)
--print( player.y)
--print( B_x )
--print( B_y )
--------------------------------
elseif secret == "ON MOFO" then
g.setColor(255,255,255,255)
g.setFont(small)
g.print("HOW DID YOU FIND THIS?! YOU SHOULDN't BE HERE!",32,32)
g.print("Well, since you're here,reply on my LOVE2D, post,",32,64)
g.print("' I found the secret, and I DIDN'T USE THE CODE TO HELP. '",32,96)
g.print(" :) ",32,128)
g.print("Press '1' and 'Enter' at the same time to continue",32,160)
end
end
Man Puzz, you always got my back xDPuzzlem00n wrote:Ah, and yet still probs with love.draw... You may notice that Nsmurf's congratulations no longer prints on level 2. This' should fix that, if I'm understanding how the secret works:
Here's a tougie - procedural generated levels.WolfNinja2 wrote:Puzzlem00n wrote: So, what does everyone think should be in 0.5?
Users browsing this forum: Google [Bot] and 2 guests