I'm using Hardon Collider to make a platform game, and i have a problem. The "ground" (a green rectangle until i solve this problem) isn't solid, i made a -theorically- working on_collide function, but the player (that for some other reason doesn't use the image it should use) passes right trough it. Also, the camera doesn't follow the player.
Before asking why the rectangle is 6000px wide,it is because i wanted to test also the camera.
In the .rar (not .love, for editing it's better the zipped one I think) you'll find some main-.lua, mainOld.lua etc. They're tutorial/old files i use only to copy-paste or to look the old scripts.
EDIT : Partially solved the animation problem, I changed to anim8. But still, even if the player X pos and Y pos update correctly on the debug informations, the image and the player state(variable to decide which image has to be used) don't. The image falls but it doesn't move horizontally, and the player state is still at "falling" .
Please help.
[Unsolved]Hardon Collider Problem
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Prole
- Posts: 3
- Joined: Tue Mar 12, 2013 8:12 pm
[Unsolved]Hardon Collider Problem
- Attachments
-
- PlatformTest.rar
- Zipped game folder (not .love)
- (83.88 KiB) Downloaded 68 times
Last edited by SerTrollface on Sun Mar 17, 2013 1:36 pm, edited 2 times in total.
-
- Prole
- Posts: 3
- Joined: Tue Mar 12, 2013 8:12 pm
Re: [Hardon collider]Hardon Collider Problem
Sorry for the double post, but I really need help.
- Hexenhammer
- Party member
- Posts: 175
- Joined: Sun Feb 17, 2013 8:19 am
Re: [Unsolved]Hardon Collider Problem
But still, even if the player X pos and Y pos update correctly on the debug informations, the image and the player state(variable to decide which image has to be used) don't.
Code: Select all
-- update the player's state
player.state = Player.getState()
Code: Select all
-- returns shape's state as a string
function Player.getState()
-- if player.index == not 'player' then return end
local myState = ""
if player.ySpeed == 0 then
if player.xSpeed > 0 then
myState = "moveRight"
elseif player.xSpeed < 0 then
myState = "moveLeft"
else
myState = "stand"
end
end
if player.ySpeed < 0 then
myState = "jump"
elseif player.ySpeed > 0 then
myState = "fall"
end
return myState
end
Comparing floating point values for equality is tricky to say at least. My guess is that when your player stops on the ground his ySpeed is not actually exactly 0 but some floating point value close to zero.
Who is online
Users browsing this forum: Ahrefs [Bot] and 6 guests