Hello, I have 2 questions about my code..
1. Why does mario look like he's floating on the ground?
2. Why does mario fall through the ground after a minute or two? Does it have something to do with garbage collecting?
Thanks in advance.
2 questions..
2 questions..
- Attachments
-
- mario.love
- (270.15 KiB) Downloaded 126 times
Twitta! http://twitter.com/#!/CodaBrink
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: 2 questions..
You have to store a reference to the shapes:Deecodeuh wrote:2. Why does mario fall through the ground after a minute or two? Does it have something to do with garbage collecting?
Code: Select all
function generateLevel()
--ground
ground = love.physics.newBody(world, 0, 576, 0)
ground_shape = love.physics.newRectangleShape(ground, 0, 0, 15360, 64)
--left wall
wall = love.physics.newBody(world, 0, 0, 0)
wall_shape = love.physics.newRectangleShape(wall, 0, 0, 10, 1000)
end
Help us help you: attach a .love.
Who is online
Users browsing this forum: No registered users and 1 guest