Hi
I'm very new to games so I may have this all wrong. I'm playing with a platformer and have a character doing an nice walk left, stand, walk right animation and jump with gravity. The next thing I need to do is add some obstacles and platforms to jump to etc. I'm trying to work out the optimal way to hit test when the character has hit a side of an obstacle so I'm looking for ideas. Obviously we don't want to hit test on every obstacle on the level each move so I was wondering about creating an array or list of obstacles when the game starts and somehow filtering it to obstacles within a reasonable range of the character. Anyway... interested in ideas or methods on what is normally done.
One idea that occurs to me is designing the whole level in an image editor and then just using intersect on the level image. Probably not the best memory and processor wise but it sure would simplify the game design... I guess you could get the same thing by grouping all the obstacles and floor and using intersect on that... which would reduce memory use but not processing on the intersect.
Cheers
Monte
Platformer floor hit testing
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Platformer floor hit testing
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/
Re: Platformer floor hit testing
Malte had a game where you had to jump up some platforms which I believe he made using Animation Engine (or Arcade Engine as it was originally called )
Re: Platformer floor hit testing
Hmm... I'll look into animation engine but I was hoping for a simple solution because I'm doing this for some app dev workshops at the local community centre. I'm using some of the CC game designs from http://www.vickiwenderlich.com for game loop examples. First one is mole whack (good example of using layers to make the hole), then cat jump (side scroller) and now Im playing with super kuwalio (platformer) although I might follow on from cat jump with space flier because they are both side scrollers but space flier has a parallax background rather than static.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/
-
- Livecode Opensource Backer
- Posts: 328
- Joined: Mon Dec 05, 2011 5:34 pm
- Location: Thailand
- Contact:
Re: Platformer floor hit testing
Hi,
You might want to try and check out the Game Academy videos - if you can. They dealt with collision detection and so forth. You should get a good understanding of some of the processes from those.
Cheers,
Dave
You might want to try and check out the Game Academy videos - if you can. They dealt with collision detection and so forth. You should get a good understanding of some of the processes from those.
Cheers,
Dave
Coding in the Sun - So much Fun.
Visit http://electronic-apps.info for released App information.
Visit http://electronic-apps.info for released App information.
Re: Platformer floor hit testing
Hmm, I understand collision detection. What I'm looking for are optimization methods if the character can move around the whole level. I've since just tried a method where some attributes of tiles Are preloaded into an array at game start and then looped over each move. Seems to work fine on desktop but I don't know about mobile. I'm not using intersect in alpha values so maybe that's the main issue.
Cheers
Monte
Cheers
Monte
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/
Re: Platformer floor hit testing
Seriously simplified things when I moved to two separate object types. Floor and barrier. Floors only stop the object moving down. Barriers only stop the object moving left and right.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/