PlatformGuy! V0.4

Show off your games, demos and other (playable) creations.
User avatar
WolfNinja2
Party member
Posts: 150
Joined: Wed Oct 24, 2012 10:10 pm

Re: PlatformGuy! V0.3

Post by WolfNinja2 »

substitute541 wrote:
WolfNinja2 wrote:
Puzzlem00n wrote:It works, I guess. It would be better if you had to collect the bullets somehow, if you want an idea! And if the amount of bullets weren't just displayed in a number, maybe a bar of some sort.
That sounds pretty cool, and i'll have little boxes that refill your supply, but a little graphic might be nice for the next update :)

-Wolf
It's actually pretty easy to create the bar, just add a number which divides your current bullets (for example, 2) to your maximum bullets (for example, 10). Use that percentage (current/max) as the scale for the bar. If you don't know, it's like

Code: Select all

love.graphics.rectangle("fill", x, y, width * (current/max), height)
Oh the wonders of programming :P
Now THAT is freaking epic. I could even add a little 1 - 8 graphic under it! THANKS!!!
I might use this , or have my artist make a little bullet that i can add another for each bullet.... either way could be cool!
B-Man99
Prole
Posts: 36
Joined: Wed Jul 25, 2012 10:51 pm
Location: Right behind you. I know you looked. Heck, even I looked

Re: PlatformGuy! V0.3

Post by B-Man99 »

And THAT is why us programmers are so flippin awesome.

LOVING THE GAME!!!
User avatar
WolfNinja2
Party member
Posts: 150
Joined: Wed Oct 24, 2012 10:10 pm

Re: PlatformGuy! V0.3

Post by WolfNinja2 »

B-Man99 wrote:And THAT is why us programmers are so flippin awesome.
LOVING THE GAME!!!
Thanks B!
v0.4 is coming out soon so be on the lookout :)

-Wolf
User avatar
WolfNinja2
Party member
Posts: 150
Joined: Wed Oct 24, 2012 10:10 pm

Re: PlatformGuy! V0.4

Post by WolfNinja2 »

V0.4 is out!
TELL MEH WHAT YA THINK! LIKE THE ANIMATION?
HOW ABOUT THE BULLET COUNTER? :)

-Wolf
User avatar
Qcode
Party member
Posts: 170
Joined: Tue Jan 10, 2012 1:35 am

Re: PlatformGuy! V0.4

Post by Qcode »

The animation plays in mid air which is kind of weird. I found the secret, and I DIDN'T USE THE CODE TO HELP.
But here are some comments on your code. You forgot to set the gamestate back to level 1 so we instantly start on level 4. That also showed me you're using separate gamestates for each different level. Though that is something you can do, an alternative would be to make a single game gamestate and just switch levels in between that. It would remove the need to create new ones each level, and would probably speed up the development process. Just a quick suggestion.
Another thing is you don't seem to know what a numeric for loop is. So let me teach you.
A numeric for loop simply loops through numbers one at a time from a start point to an end point using whatever step you wanted. An example:

Code: Select all

for i = 1, 100 do
print(i)
end
The first value (1) is the starting point and the second value (100) is the end point. So that would print 1 through 100. Another example:

Code: Select all

for i = 100, 1, -1 do
print(i)
end
That -1 is the step, so it would go through all the numbers 1-100 backwards. You can supply anything you want for the start, end and step (they can be variables as well like for i = start, stop, step do)
So now this can be used in some clever ways.
Here's your function bullet_counter_draw()

Code: Select all

function bullet_counter_draw()
	if P_bullets == 1 then
	g.draw(B_pic,32,26, math.rad(-90),4,4)
	end
	if P_bullets == 2 then
	g.draw(B_pic,32,26, math.rad(-90),4,4)
	g.draw(B_pic,64,26, math.rad(-90),4,4)
	end
	if P_bullets == 3 then
	g.draw(B_pic,32,26, math.rad(-90),4,4)
	g.draw(B_pic,64,26, math.rad(-90),4,4)
	g.draw(B_pic,96,26, math.rad(-90),4,4)
	end
	if P_bullets == 4 then
	g.draw(B_pic,32,26, math.rad(-90),4,4)
	g.draw(B_pic,64,26, math.rad(-90),4,4)
	g.draw(B_pic,96,26, math.rad(-90),4,4)
	g.draw(B_pic,128,26, math.rad(-90),4,4)
	end
	if P_bullets == 5 then
	g.draw(B_pic,32,26, math.rad(-90),4,4)
	g.draw(B_pic,64,26, math.rad(-90),4,4)
	g.draw(B_pic,96,26, math.rad(-90),4,4)
	g.draw(B_pic,128,26, math.rad(-90),4,4)
	g.draw(B_pic,160,26, math.rad(-90),4,4)
	end
	if P_bullets == 6 then
	g.draw(B_pic,32,26, math.rad(-90),4,4)
	g.draw(B_pic,64,26, math.rad(-90),4,4)
	g.draw(B_pic,96,26, math.rad(-90),4,4)
	g.draw(B_pic,128,26, math.rad(-90),4,4)
	g.draw(B_pic,160,26, math.rad(-90),4,4)
	g.draw(B_pic,192,26, math.rad(-90),4,4)
	end
	if P_bullets == 7 then
	g.draw(B_pic,32,26, math.rad(-90),4,4)
	g.draw(B_pic,64,26, math.rad(-90),4,4)
	g.draw(B_pic,96,26, math.rad(-90),4,4)
	g.draw(B_pic,128,26, math.rad(-90),4,4)
	g.draw(B_pic,160,26, math.rad(-90),4,4)
	g.draw(B_pic,192,26, math.rad(-90),4,4)
	g.draw(B_pic,224,26, math.rad(-90),4,4)
	end
	if P_bullets == 8 then
	g.draw(B_pic,32,26, math.rad(-90),4,4)
	g.draw(B_pic,64,26, math.rad(-90),4,4)
	g.draw(B_pic,96,26, math.rad(-90),4,4)
	g.draw(B_pic,128,26, math.rad(-90),4,4)
	g.draw(B_pic,160,26, math.rad(-90),4,4)
	g.draw(B_pic,192,26, math.rad(-90),4,4)
	g.draw(B_pic,224,26, math.rad(-90),4,4)
	g.draw(B_pic,256,26, math.rad(-90),4,4)
	end
end
This huge thing with a numeric for loop can be shortened to just

Code: Select all

for i = 1, P_bullets do
     g.draw(i*32, 26, math.rad(-90), 4, 4)
end
Yeah these things can be pretty useful.
User avatar
micha
Inner party member
Posts: 1083
Joined: Wed Sep 26, 2012 5:13 pm

Re: PlatformGuy! V0.4

Post by micha »

It very much looks like a game now.

I have one suggestion: Make the hitbox of the player a bit smaller than the grid size. I could not jump into the flat gap above the start. Also I think it would feel better if the player is not totally squeezed inbetwee two block, but can at least move a little.
User avatar
WolfNinja2
Party member
Posts: 150
Joined: Wed Oct 24, 2012 10:10 pm

Re: PlatformGuy! V0.4

Post by WolfNinja2 »

I might implement this, but I assure you it's all possible, glitch free. It could be an issue of lag on you're computer? Anyway, how I do that jump is to, when the very edge of my characters left side is still on the block, to just tap up so it's considered a smaller jump and dosen't try to add on. Seems work a bit better. I could record a video of the whole game if it's really hard. But, I won't show the secret spot.

:)

EDIT:Realize you're talking about somewhere COMPLETELY different, for that one. I just SMASH THE LEFT KEY LIKE A BAUWS! :D

-Wolf
Last edited by WolfNinja2 on Mon Dec 03, 2012 11:07 am, edited 1 time in total.
User avatar
WolfNinja2
Party member
Posts: 150
Joined: Wed Oct 24, 2012 10:10 pm

Re: PlatformGuy! V0.4

Post by WolfNinja2 »

WHOOPS. I'm an idiot.... level 1 is actually level 4....... DON'T MIND THAT! FIXING IT :D
User avatar
Puzzlem00n
Party member
Posts: 171
Joined: Fri Apr 06, 2012 8:49 pm
Contact:

Re: PlatformGuy! V0.4

Post by Puzzlem00n »

Nice, although yeah, you've gotta make it go through each level instead of quitting after the first... But uh, you probably want this:

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)
	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 )
	
	--------------------------------
	
	if gamestate == "lvl 2" then
	g.setColor(0,255,0,100)
	g.print("Congratz to Nsmurf for finding the Waffles!",40,268)
		end
	end
	
	if 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
	
	if gamestate == "lvl 4" then
		g.setColor(255,255,255,255)
		g.draw(tile,768,320,0,2,2,0)
	end
	
end
To look like this:

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)
		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 gamestate == "lvl 2" then
			g.setColor(0,255,0,100)
			g.print("Congratz to Nsmurf for finding the Waffles!",40,268)
		end
		elseif gamestate == "lvl 4" then
			g.setColor(255,255,255,255)
			g.draw(tile,768,320,0,2,2,0)
		end
	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
You can't just throw ends in random places until there are no errors, you have to put them in the right places. This isn't the first time I've found your code to have completely misplaced end statements all over. This should do what you want.

Other than that, the game's really coming along! :D
I LÖVE, therefore I am.
User avatar
WolfNinja2
Party member
Posts: 150
Joined: Wed Oct 24, 2012 10:10 pm

Re: PlatformGuy! V0.4

Post by WolfNinja2 »

Qcode wrote:The animation plays in mid air which is kind of weird. I found the secret, and I DIDN'T USE THE CODE TO HELP.
But here are some comments on your code. You forgot to set the gamestate back to level 1 so we instantly start on level 4. That also showed me you're using separate gamestates for each different level. Though that is something you can do, an alternative would be to make a single game gamestate and just switch levels in between that. It would remove the need to create new ones each level, and would probably speed up the development process. Just a quick suggestion.
Another thing is you don't seem to know what a numeric for loop is. So let me teach you.
A numeric for loop simply loops through numbers one at a time from a start point to an end point using whatever step you wanted. An example:

Code: Select all

for i = 1, 100 do
print(i)
end
The first value (1) is the starting point and the second value (100) is the end point. So that would print 1 through 100. Another example:

Code: Select all

for i = 100, 1, -1 do
print(i)
end
That -1 is the step, so it would go through all the numbers 1-100 backwards. You can supply anything you want for the start, end and step (they can be variables as well like for i = start, stop, step do)
So now this can be used in some clever ways.
Here's your function bullet_counter_draw()

Code: Select all

function bullet_counter_draw()
	if P_bullets == 1 then
	g.draw(B_pic,32,26, math.rad(-90),4,4)
	end
	if P_bullets == 2 then
	g.draw(B_pic,32,26, math.rad(-90),4,4)
	g.draw(B_pic,64,26, math.rad(-90),4,4)
	end
	if P_bullets == 3 then
	g.draw(B_pic,32,26, math.rad(-90),4,4)
	g.draw(B_pic,64,26, math.rad(-90),4,4)
	g.draw(B_pic,96,26, math.rad(-90),4,4)
	end
	if P_bullets == 4 then
	g.draw(B_pic,32,26, math.rad(-90),4,4)
	g.draw(B_pic,64,26, math.rad(-90),4,4)
	g.draw(B_pic,96,26, math.rad(-90),4,4)
	g.draw(B_pic,128,26, math.rad(-90),4,4)
	end
	if P_bullets == 5 then
	g.draw(B_pic,32,26, math.rad(-90),4,4)
	g.draw(B_pic,64,26, math.rad(-90),4,4)
	g.draw(B_pic,96,26, math.rad(-90),4,4)
	g.draw(B_pic,128,26, math.rad(-90),4,4)
	g.draw(B_pic,160,26, math.rad(-90),4,4)
	end
	if P_bullets == 6 then
	g.draw(B_pic,32,26, math.rad(-90),4,4)
	g.draw(B_pic,64,26, math.rad(-90),4,4)
	g.draw(B_pic,96,26, math.rad(-90),4,4)
	g.draw(B_pic,128,26, math.rad(-90),4,4)
	g.draw(B_pic,160,26, math.rad(-90),4,4)
	g.draw(B_pic,192,26, math.rad(-90),4,4)
	end
	if P_bullets == 7 then
	g.draw(B_pic,32,26, math.rad(-90),4,4)
	g.draw(B_pic,64,26, math.rad(-90),4,4)
	g.draw(B_pic,96,26, math.rad(-90),4,4)
	g.draw(B_pic,128,26, math.rad(-90),4,4)
	g.draw(B_pic,160,26, math.rad(-90),4,4)
	g.draw(B_pic,192,26, math.rad(-90),4,4)
	g.draw(B_pic,224,26, math.rad(-90),4,4)
	end
	if P_bullets == 8 then
	g.draw(B_pic,32,26, math.rad(-90),4,4)
	g.draw(B_pic,64,26, math.rad(-90),4,4)
	g.draw(B_pic,96,26, math.rad(-90),4,4)
	g.draw(B_pic,128,26, math.rad(-90),4,4)
	g.draw(B_pic,160,26, math.rad(-90),4,4)
	g.draw(B_pic,192,26, math.rad(-90),4,4)
	g.draw(B_pic,224,26, math.rad(-90),4,4)
	g.draw(B_pic,256,26, math.rad(-90),4,4)
	end
end
This huge thing with a numeric for loop can be shortened to just

Code: Select all

for i = 1, P_bullets do
     g.draw(i*32, 26, math.rad(-90), 4, 4)
end
Yeah these things can be pretty useful.
Thanks! And I fixed the download already xD
Nice job with the secret!
Also, I just don't really get table's enough to think like that automatically.

EDIT: I tried the for loop you suggested, does not work, says expected userdata.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests