jumping tutorial?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- toaster468
- Citizen
- Posts: 77
- Joined: Sat Nov 06, 2010 11:30 pm
jumping tutorial?
Ive been looking around and i cannot seem to find an example for some simple jumping! Can someone please tell me a place where i can find some simple code?
- nevon
- Commander of the Circuloids
- Posts: 938
- Joined: Thu Feb 14, 2008 8:25 pm
- Location: Stockholm, Sweden
- Contact:
Re: jumping tutorial?
There's really no way to write such a tutorial, since it all depends entirely on what the rest of your code looks like.
- toaster468
- Citizen
- Posts: 77
- Joined: Sat Nov 06, 2010 11:30 pm
Re: jumping tutorial?
I would write a game around it so if you could please write up some simple code, I would be grateful or at least point me to a simple physics example.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: jumping tutorial?
If you like to see a simple platformer, you could take a look at Jump Game (you can get it here: http://love2d.org/forums/viewtopic.php? ... 053#p21042), which is a garbled mess, but it could probably serve as a quick introduction.
Help us help you: attach a .love.
- toaster468
- Citizen
- Posts: 77
- Joined: Sat Nov 06, 2010 11:30 pm
Re: jumping tutorial?
that is very messy code, I cannot really understand it, i will post my code to see if anyone can help me
i deleted all the stuff that i tried so feel free to add jumping if you will, i can do the rest and i will include you in the credits
Code: Select all
-- Office Man Stan --
function love.load()
love.graphics.setMode(320, 320)
love.graphics.setCaption( "Office Man Stan" )
end
function love.update(dt)
end
function love.draw()
end
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: jumping tutorial?
I'm sorry, but this is not how programming works. ![Wink ;)](./images/smilies/ms-wink.png)
I can give you code, but that will not help you. It seems you need to start at the beginning.
![Wink ;)](./images/smilies/ms-wink.png)
I can give you code, but that will not help you. It seems you need to start at the beginning.
Help us help you: attach a .love.
- TechnoCat
- Inner party member
- Posts: 1611
- Joined: Thu Jul 30, 2009 12:31 am
- Location: Milwaukee, WI
- Contact:
Re: jumping tutorial?
These are both really bad, very old examples of things I have done. But they can probably help you get started.
without love.physics https://bitbucket.org/dannyfritz/jumpbu ... .lua#cl-40
with love.physics https://bitbucket.org/dannyfritz/megama ... .lua#cl-21
without love.physics https://bitbucket.org/dannyfritz/jumpbu ... .lua#cl-40
with love.physics https://bitbucket.org/dannyfritz/megama ... .lua#cl-21
- toaster468
- Citizen
- Posts: 77
- Joined: Sat Nov 06, 2010 11:30 pm
Re: jumping tutorial?
well im not new to programming i know how this works and i like to read up about things work before i try it, but i could not find anything on the wiki about jumping. I know now that i should use impulse but i dont know how to save a picture to a table like in the physics example. would this work?:
I did this in the physics example but the thing is that i need to use a picture instead of a circle
Code: Select all
bodies = {}
bodies[0] = love.graphics.newImage("picturelocationhere.PNG")
...
--later on in the code
bodies[0]:applyImpulse( 0, -1000)
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: jumping tutorial?
It seems that you are under the impression that making a jumping character takes 10 or 20 lines.
I'm afraid it takes a bit more than that.
I can help you, but I will not create the code for you. Sorry.
What I can do is help you gradually transform your code into a jumping one. Step by step.
First, I want you to create an image for your 'jumping man' and another one for the ground.
You will have to load the images inside love.load (with love.graphics.newImage) and draw them inside love.draw, using love.graphics.draw. Try not to make the ground image too big.
Draw the two images so the character seems to be on top of the ground.
When you finish with that, we'll go to the next step.
I'm afraid it takes a bit more than that.
I can help you, but I will not create the code for you. Sorry.
What I can do is help you gradually transform your code into a jumping one. Step by step.
First, I want you to create an image for your 'jumping man' and another one for the ground.
You will have to load the images inside love.load (with love.graphics.newImage) and draw them inside love.draw, using love.graphics.draw. Try not to make the ground image too big.
Draw the two images so the character seems to be on top of the ground.
When you finish with that, we'll go to the next step.
When I write def I mean function.
- toaster468
- Citizen
- Posts: 77
- Joined: Sat Nov 06, 2010 11:30 pm
Re: jumping tutorial?
ok, i get this error alot but i have all my images in my folder and they are the right names but i keep getting an error that they arent there. I am running a 64bit OS so could that be the problem?
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest