# Platform Game

**URL:** <https://forum.kirupa.com/t/platform-game/262352>\
**Category:** Uncategorized\
**Created:** [June 5, 2008, 10:30am UTC](https://forum.kirupa.com/t/platform-game/262352 "2008-06-05T10:30:36Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Krabex](https://avatars.discourse-cdn.com/v4/letter/k/4da419/32.png) [@Krabex](https://forum.kirupa.com/u/Krabex)\
**Post date:** [June 5, 2008, 10:30am UTC](https://forum.kirupa.com/t/platform-game/262352/1 "2008-06-05T10:30:36Z")

</div>

Hey people…

Im just after some ideas as im currently working on a platform game but im running into some problems. Im using bitmapData and an Array to draw the map where 1 = wall, and 0 = blank space. This works great and my hero collides with ‘tilespace’ by determining the next tile he will be on yada yada, but how will i go about elevators, as they are moving!.. I thought about using a movieclip but i would prefer to drop them all together as bitmapData is faster.

:thumb2: ty

---

<div class="post-metadata">

**Author:** ![bpalermo](https://avatars.discourse-cdn.com/v4/letter/b/9dc877/32.png) [@bpalermo](https://forum.kirupa.com/u/bpalermo)\
**Post date:** [June 5, 2008, 12:03pm UTC](https://forum.kirupa.com/t/platform-game/262352/2 "2008-06-05T12:03:24Z")

</div>

I think you can hitTest BitmapData. I’ll check this to be sure…

---

<div class="post-metadata">

**Author:** ![Krabex](https://avatars.discourse-cdn.com/v4/letter/k/4da419/32.png) [@Krabex](https://forum.kirupa.com/u/Krabex)\
**Post date:** [June 5, 2008, 1:37pm UTC](https://forum.kirupa.com/t/platform-game/262352/3 "2008-06-05T13:37:12Z")

</div>

well thats great, so i should create a new bitmapData for every elevator?

---

<div class="post-metadata">

**Author:** ![bpalermo](https://avatars.discourse-cdn.com/v4/letter/b/9dc877/32.png) [@bpalermo](https://forum.kirupa.com/u/bpalermo)\
**Post date:** [June 5, 2008, 4:01pm UTC](https://forum.kirupa.com/t/platform-game/262352/4 "2008-06-05T16:01:29Z")

</div>

No. You’d have to attach them to MC to get them to show on screen anyway. You could just perform standard MC hittesting with the said MCs. Of course every elevator must have a MC, but you’ll attach the same BitmapData to all of them.

//Edit: It’s good to highlight that I never actually tried this, it just sounds logical to me based on what I know about MCs and BitmapData, but I may be completely wrong. Still, I guess it’s worth checking.

---

<div class="post-metadata">

**Author:** ![bluemagica](https://avatars.discourse-cdn.com/v4/letter/b/a4c791/32.png) [@bluemagica](https://forum.kirupa.com/u/bluemagica)\
**Post date:** [June 6, 2008, 4:02am UTC](https://forum.kirupa.com/t/platform-game/262352/5 "2008-06-06T04:02:53Z")

</div>

BitmapData can use hitTest with another BitmapData object only, and at pixel level…During rendering, BitmapData is mostly used to generate non-Interactive stuff, Like tiled backgrounds and layer design.Since its just a copy, or, umm, screenshot of a mc…

---

<div class="post-metadata">

**Author:** ![substance](https://avatars.discourse-cdn.com/v4/letter/s/c6cbf5/32.png) [@substance](https://forum.kirupa.com/u/substance)\
**Post date:** [June 7, 2008, 4:24am UTC](https://forum.kirupa.com/t/platform-game/262352/6 "2008-06-07T04:24:33Z")

</div>

[QUOTE=bluemagica;2337777]BitmapData can use hitTest with another BitmapData object only, and at pixel level…During rendering, BitmapData is mostly used to generate non-Interactive stuff, Like tiled backgrounds and layer design.Since its just a copy, or, umm, screenshot of a mc…[/QUOTE]

I use BMD (BitmapData) hittest for my platformer, you can hittest it with MC’s or other images fine. It’s a bit faster than mc’s hittest therefore the best option for pixel-level collision.

---

<div class="post-metadata">

**Author:** ![bluemagica](https://avatars.discourse-cdn.com/v4/letter/b/a4c791/32.png) [@bluemagica](https://forum.kirupa.com/u/bluemagica)\
**Post date:** [June 7, 2008, 10:48am UTC](https://forum.kirupa.com/t/platform-game/262352/7 "2008-06-07T10:48:32Z")

</div>

> [@substance;2338452](#):
>
> I use BMD (BitmapData) hittest for my platformer, you can hittest it with MC’s or other images fine. It’s a bit faster than mc’s hittest therefore the best option for pixel-level collision.

interesting! Can i see your coding to understand the implementation?

---

<div class="post-metadata">

**Author:** ![bpalermo](https://avatars.discourse-cdn.com/v4/letter/b/9dc877/32.png) [@bpalermo](https://forum.kirupa.com/u/bpalermo)\
**Post date:** [June 8, 2008, 6:47pm UTC](https://forum.kirupa.com/t/platform-game/262352/8 "2008-06-08T18:47:00Z")

</div>

Yep. It is TUNCAYS, but he needs it to moving objects. Array map is not really an option for those. 🙂

---

<div class="post-metadata">

**Author:** ![substance](https://avatars.discourse-cdn.com/v4/letter/s/c6cbf5/32.png) [@substance](https://forum.kirupa.com/u/substance)\
**Post date:** [June 9, 2008, 5:26am UTC](https://forum.kirupa.com/t/platform-game/262352/9 "2008-06-09T05:26:58Z")

</div>

[QUOTE=bluemagica;2338504]interesting! Can i see your coding to understand the implementation?[/QUOTE]

Hmm, it’s pretty simple. Something like:

```php
if (background.hitTest(new Point(0,0),0xFF,new Point(hero.feet.x,hero.feet.y)))
{
//hero is touching background
}

```

‘background’ being a BMD object that is essentialy the game’s stage saved out as a .png.

---

<div class="post-metadata">

**Author:** ![hjj589](https://avatars.discourse-cdn.com/v4/letter/h/22d042/32.png) [@hjj589](https://forum.kirupa.com/u/hjj589)\
**Post date:** [June 12, 2008, 1:42am UTC](https://forum.kirupa.com/t/platform-game/262352/10 "2008-06-12T01:42:58Z")

</div>

[quote=Krabex;2337138]Hey people…

Im just after some ideas as im currently working on a platform game but im running into some problems. Im using bitmapData and an Array to draw the map where 1 = wall, and 0 = blank space. This works great and my hero collides with ‘tilespace’ by determining the next tile he will be on yada yada, but how will i go about elevators, as they are moving!.. I thought about using a movieclip but i would prefer to drop them all together as bitmapData is faster.

:thumb2: ty[/quote]

Yes, i think so.
