Thursday, June 25, 2009

Attention Future Tom!

This message is for Future Tom. This way he doesn't forget what's going on.

So in terms of collision with the ground I'm thinking of trying something with detecting what angle the player is touching the ground at. Since the player will always walk at a 90 degree angle from the ground if they are standing on a slope then the player will walk 90 degrees based on the type of slope.

Now there could be two different options here.

One: We could scrap the whole "one movieclip for the ground" thing. This would mean taking a page out of the red book and having tile like ground. I could define different angled ground and give them an angle property. Depending on which one the player touches and what direction they are facing then they will move that angle.

PROS:
This would most likely take the least amount of code (and hopefully math).
This will also make the bullets disappear correctly.

CONS:
This will be limited. We could only have around three different angles.
The level designer (Joe) would have to place the ground tile by tile.

Two: If we want to keep the one movieclip I would have to use a formula to detect what angle the ground is and what angle the player is. Then do some type of crazy black magic to get the answer I want.

PROS:
Any type of slope you can imagine. Paint away.

CONS:
This may eat up a lot of memory.
I don't know this kind of math. (This applies no matter what I suppose)
Still have the bullet issue.


Of course this is all assuming this will work. I know what you must be thinking, why don't you just copy and paste some working collision code. Well first of all that's stealing moron. Second, I would really like to come up with a solution on my own. This one is kind of sort of a little bit original. It really has to do with bouncing a ball, but I think with a bit of work I can make it work with a walking player.

That's about it. I should go to sleep now. Before I forget this is the website I'm looking at for bouncing ball angle brain hurting goodness:

Enjoy!

2 comments:

  1. This seems like it will be a hundred times more accurate than our current code. I think this will also lend itself to the velocity we want to incorporate.

    ReplyDelete
  2. I dig the plans. Whatever one happens will be sweet. If I have to place tiles, no prob. I'm down with renting a clown and beating his ass.

    ReplyDelete