Day 3 is levels and collisions day
Hi fellow PyWeek-ers !Hope you're all right.
So yesterday I said I will talk about the enemies ... well I lied :) I prefer talking about the powers and the levels' rooms.
So basically, this is 1 room. The first room of the first level to be exact. You already know Stan.
You can see 2 apple cores. Stan is here to find food remember ? So on his way to the dreamed meal, he will find apple cores not to starve to death. (we thought about the classic coins but he didn't want to eat them)
The orange gem on the platform next to him is the Fire gem. No surprise here : it gives Stan the ability to launch fire balls. And this in two purposes:
- kill the enemies
- burn the obstacles preventing him from reaching his meal
But enougth about FEAW for today, we still have 4 entries to learn more about it :)
So what did we do during this 3rd day ?
Well cha keeped creating assets and doing some level design. We now have 3 levels waiting to be implemented in the game. We might be able to have all the levels we wanted by the end of the week.
elghinn finally find a convenient solution to handle the levels as he wanted to. I won't say more about this today as he will stop his diary-lazyness for 1 day tomorrow and will talk about his system ;)
And me? Well I'm glad you ask!
I took care of the Stan/ground collision system. I've been wanting to do such a system for a platformer for a long time but I never had (took?) the occasion to do it. But now I can check that on my list :D
The simplest thing would have been to have a flat ground, but it would have been too easy ... plus cha wanted uneven grounds so I accepted to let her express her art with uneven grounds (and then my stress got bigger! Damn graphic artists! :p)
I was a little worried about this part of the dev as I had one idea but had some concerns about the performances.
My idea was quite classic though: have a black and white image for each background and check the box of the player on these images loaded in memory. I also considered partitionning the ground into lots of simple geometries but I finally prefered my first solution.
I already tried this solution in a personal space game though (a PixelJunkShooter-like) and I wasn't pleased with the result of the collisions: how to know if a collision comes from the top or the left?
After some google-time I found a solution: create 4 boxes! 1 for the top,1 for the bottom, 1 for the left and 1 for the right.
Like that, depending on the player input, I can check to collision with the boxe(s) I want and act accordingly. So I did it and was quite pleased with the result.
I just had to spend a few minutes tuning the boxes in order and the result to collisions and Stan was able to run on uneven grounds \o/
And that's it for today.
Good luck and be brave: we almost reached the half-week milestone \o/
(log in to comment)
Comments
http://www.hobbygamedev.com/adv/2d-platformer-advanced-collision-detection/
I didn't implement all though but just took the 4 boxes idea. I might try the other things someday.
Python Jedi on 2011/09/14 01:41:
I might just try this, but I have plenty to do tomorrow, and I think I have come up with a work-around, no platforms! yeah, I can't call it a platformer, but it frees up level design and allows it to be more like an RPG, from a sidescrolling perspective... (I just thought that up a minute ago)