Page 1 of 3

Platformer X™

Posted: Sun Apr 22, 2012 6:24 am
by Banoticus
Platformer X

Re: Platformer X

Posted: Tue Apr 24, 2012 5:26 pm
by Davidobot
Screenshot:
Image

Re: Platformer X v.0.0002

Posted: Thu Apr 26, 2012 5:21 pm
by Banoticus
I am having a bit of trouble with collisions. Can anybody help me. ^^
Here is the next version of the game in the screenshot above.
Platformer X.love.zip
v.0.0002
(8.07 KiB) Downloaded 457 times

Re: Platformer X

Posted: Thu Apr 26, 2012 6:24 pm
by Larsii30
Hi Banoticus,

great to see you guys working on a game.

I've got some words I would like to share with you :

May you should learn first a bit about the engine before do big plans like release the game on steam or/and Desura.
This game could be a great way to learn everything you need to code with Löve I think.

May you try to set up some system for developing your game like this:

1. Planning your game
2. Create some simple artwork / Layout plans
3. Write the code / do the graphics etc.
4. Bugfixes etc.

If you plan the game first, you can do everything else much faster after the planning phase.
Also for team development, for example it's better to give the guy how do the graphics some kind of script, so the guy
could start more efficiently draw some stuff for the programmer to implement.

Collision trouble:

The easiest way to implement some box collisions was to compare positions of two objects.
Here some code (not by me btw):

Code: Select all

if pos.x > rect.x and pos.x < rect.x + rect.w and pos.y > rect.y and pos.y < rect.y + rect.h then
			return
			true 
		else
			return 
			false 
		end
This check if a calculated box overlapping a second box.

Try it or do some math on your own. :)

p.s sorry for the bad english.

EDIT: oh and I forgot some things. Your packages ( the downloads ) was packed wrong . You have to select all game items and dir's (main.lua, gfx-dir etc) and pack it as a zip file. to get a .love file you have to change the ".zip" to ".love". (for Windows)
You could find everything you need for pack it correct here: https://love2d.org/wiki/Getting_Started


greets

Re: Platformer X

Posted: Thu Apr 26, 2012 6:59 pm
by Davidobot
K, thanks for the quick reply, but this is what a reaaaaaalllyyyyy don't like: people saying you should do that or this or I don't think your game is ready to release on Desura.

PS Sorry I am very tired.

Re: Platformer X

Posted: Thu Apr 26, 2012 7:05 pm
by Larsii30
(edited)

You're right.I accept this opinion.

Take it as some wise words from a guy who like to help you.
Take it easy.

Re: Platformer X

Posted: Fri Apr 27, 2012 4:24 pm
by Banoticus
Thanks for the code.
I am sorry if davidobot is a bit grumpy. The best thing to do is just ignore him a and he'll get over it. :)
P.S. Can you please give me the name of your website.

Re: Platformer X

Posted: Fri Apr 27, 2012 6:24 pm
by mikaldinho95
Looks promising enough, can't wait to see more!

Re: Platformer X collisions

Posted: Sat Apr 28, 2012 6:13 am
by Banoticus
I am having some trouble with collisions can anybody help please. :)
The problem is the guy is stuck in the air and can't move. :ehem:
Can you also tell me what i did wrong please.
Platformer X.love.zip
almost v.0.0003
(8.36 MiB) Downloaded 342 times
EDIT: sorry i add proper file now ⇪

Re: Platformer X

Posted: Sat Apr 28, 2012 8:55 am
by Zeliarden
Yo! looked through your code and addes some notes of what could be the problem...

Code: Select all

function love.update(dt)
	fps = love.timer.getFPS()

	--**if player.x > 1000 and player.x < 1000 + 32 and player.y > 500 and player.y < 500 + 32 then = makes your collision a 32x32 square... try just player.y > rect.y **
	if player.x > rect.x and player.x < rect.x + rect.w and player.y > rect.y and player.y < rect.y + rect.h then
		player.collision = true
			return true --** this returns (exits) love.update(dt) function as you are not in any other function... remove this**
	else
       	return false -- ** use player.collision = true instead**
   	end
   	frame = dt * 30 -- I do this just because I think better this way
   	player.ySpeed = player.ySpeed + player.gravSecond * frame -- We add gravity to the ySpeed
   	player.y = player.y + player.ySpeed * frame -- We add ySpeed to the player's y position -- ** should be down at -->>
   	if player.collision then -- Are we on the ground?
      		player.y = player.y - player.ySpeed * frame -- If we are, We undo that moving down
      		player.ySpeed = 0 -- The ySpeed is reset --** you should have this before player.y = ...
     	 	player.inAir = false
   	end-- ** and add an else -->> end instead
   	if love.keyboard.isDown("right") then
		player.x= player.x+5
   	end
   	if love.keyboard.isDown("left") then
		player.x= player.x-5
   	end
end