jumping tutorial?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: jumping tutorial?
That's a nice fish, but toaster doesn't need a fish, but lessons on how to get his own fishes.
When I write def I mean function.
Re: jumping tutorial?
It's supposed to be an example of how you would write a platformer with jumping...
I get -1'd for trying to help? What is this madness? It's not sparta.
I get -1'd for trying to help? What is this madness? It's not sparta.
Hello, I am not dead.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: jumping tutorial?
You know, zac. You could try writing a real game yourself once, instead of complaining about your karma on the forums. (How can someone have negative karma?)
Help us help you: attach a .love.
Re: jumping tutorial?
I try to help him through example (that's how I learn best, and I know I'm not the only one of nearly 7 billion people like that), and you -1 me. >_>Robin wrote:You know, zac. You could try writing a real game yourself once, instead of complaining about your karma on the forums. (How can someone have negative karma?)
And I have written real games. Most are unreleased (because my interests sway to quickly to work on them).
Hello, I am not dead.
- toaster468
- Citizen
- Posts: 77
- Joined: Sat Nov 06, 2010 11:30 pm
Re: jumping tutorial?
Alright, I got the movement down and bug free, now I'm shootin' for extra credit . You can post the next step whenever you like. Thanks again guys you are all very helpful!
- toaster468
- Citizen
- Posts: 77
- Joined: Sat Nov 06, 2010 11:30 pm
Re: jumping tutorial?
Update: I've gotten the player to turn right and left depending on which button in pressed . LOVE is the most rewarding programming I have done in a long time, I cannot thank you guys enough
Re: jumping tutorial?
I forgot something in the script I provided as an example: A friction coefficient. Just so you know, all you do is multiply your x-velocity by your coefficient for a nice sliding effect. Thanks for my first ever +1.toaster468 wrote:Update: I've gotten the player to turn right and left depending on which button in pressed . LOVE is the most rewarding programming I have done in a long time, I cannot thank you guys enough
Hello, I am not dead.
- toaster468
- Citizen
- Posts: 77
- Joined: Sat Nov 06, 2010 11:30 pm
Re: jumping tutorial?
Sweet I'll keep that in mind when I add sprinting!
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: jumping tutorial?
Nice! You are doing quite fast.
The next part is : drawing your map using tiles.
Right now your map should be quite plain; basically a long horizontal corridor. But in order to spice up the jumping, you will need to have more variety. Stairs. Bottom-less pits. Platforms. That kind of thing.
For learning purposes, the best option is going tile-based.
So the first step is creating an image that you can use for your tiles on the ground and wallss. Probably a brick tile. If you don't feel like drawing it yourself, google for it (Make sure it has power-of-two dimensions, like 32x32 or 64x64 pixels). Load that new image inside love.load and call it tile_image.
Then, you need to change the way your level is modelled and drawn. The tile-based tutorial tutorial should help you on that part.
When you are sure it works correctly, create a level like the next one, with walls on both sides, ceiling and ground, a wall in the middle and two platforms (you don't need to respect these exact measures; adapt them to your tile/screen size)
Your character should appear aligned with the ground. It should be able to move left and right as before. It should ignore the walls for now. On next step, we'll deal with that.
Take your time with this one, and ask any questions you have. Also, feel free to post screenshots with your progress!
The next part is : drawing your map using tiles.
Right now your map should be quite plain; basically a long horizontal corridor. But in order to spice up the jumping, you will need to have more variety. Stairs. Bottom-less pits. Platforms. That kind of thing.
For learning purposes, the best option is going tile-based.
So the first step is creating an image that you can use for your tiles on the ground and wallss. Probably a brick tile. If you don't feel like drawing it yourself, google for it (Make sure it has power-of-two dimensions, like 32x32 or 64x64 pixels). Load that new image inside love.load and call it tile_image.
Then, you need to change the way your level is modelled and drawn. The tile-based tutorial tutorial should help you on that part.
- Start by defining a variable called map inside love.load. map will be a 2-dimensional array holding a representation of your map's tiles (see the tutorial).
- Inside love.draw, draw your map using a loop. The loop should draw tile_image several times, depending on what your map variable contains.
When you are sure it works correctly, create a level like the next one, with walls on both sides, ceiling and ground, a wall in the middle and two platforms (you don't need to respect these exact measures; adapt them to your tile/screen size)
Code: Select all
##########################################
# #
# #
# #
# # #### #
# #### # #
# # #
##########################################
Take your time with this one, and ask any questions you have. Also, feel free to post screenshots with your progress!
When I write def I mean function.
Re: jumping tutorial?
Hello, I am not dead.
Who is online
Users browsing this forum: Amazon [Bot], Bondrusiek and 3 guests