# Four-sde collision

**URL:** <https://forum.kirupa.com/t/four-sde-collision/66047>\
**Category:** programming\
**Created:** [October 1, 2004, 9:39pm UTC](https://forum.kirupa.com/t/four-sde-collision/66047 "2004-10-01T21:39:06Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Smee](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@Smee](https://forum.kirupa.com/u/Smee)\
**Post date:** [October 1, 2004, 9:39pm UTC](https://forum.kirupa.com/t/four-sde-collision/66047/1 "2004-10-01T21:39:06Z")

</div>

I’m in the process of remaking the game Sword of Mana. ([http://www.gamespot.com/gba/rpg/seikendensetsu/screenindex.html?](http://www.gamespot.com/gba/rpg/seikendensetsu/screenindex.html?))

Anyone ever accomplished a nice collision detection system in a game like this before?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 2, 2004, 3:05am UTC](https://forum.kirupa.com/t/four-sde-collision/66047/2 "2004-10-02T03:05:08Z")

</div>

I think u want to look at using distances and tiles, rather than a hitTest for ur collisions in a game like this, check out tonypas tutes for info on that, but it depends how far into making the game are u?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 2, 2004, 3:53am UTC](https://forum.kirupa.com/t/four-sde-collision/66047/3 "2004-10-02T03:53:39Z")

</div>

Hi Dr. Warm! :beam:

I have pretty well everything planned out, as far as structure goes. The only thing I have actually coded is the movement and attacking. The most important thing to me about this project is that I will be able to make easy, dynamic changes to anthing I want in the future; maps, character animations, etc. I have a editor mock up in my head also. Next step is collision! This is what I have so far.

(Be sure you don’t run too far off screen :})

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 2, 2004, 4:10am UTC](https://forum.kirupa.com/t/four-sde-collision/66047/4 "2004-10-02T04:10:25Z")

</div>

Hmm if u want it to be easily editable then u’ll have to use arrays, i only know how to do this for landscape and enemies by using tonypas tutes, i’m not sure how u think u’ll do it?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 2, 2004, 4:11am UTC](https://forum.kirupa.com/t/four-sde-collision/66047/5 "2004-10-02T04:11:58Z")

</div>

Oh! I forgot to mention the controls! :sleep:

Move character: Arrow keys  
Run: Hold “D” key  
Attack: “F” key

(And I meant four-sIde in the thread title 😊)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 2, 2004, 4:13am UTC](https://forum.kirupa.com/t/four-sde-collision/66047/6 "2004-10-02T04:13:20Z")

</div>

I didn’t even notice!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 2, 2004, 4:28am UTC](https://forum.kirupa.com/t/four-sde-collision/66047/7 "2004-10-02T04:28:31Z")

</div>

The only problem I can forsee with tiled landscapes is that I’m restricted to certain shapes, and the smaller it gets, the laggier it gets.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 2, 2004, 6:07am UTC](https://forum.kirupa.com/t/four-sde-collision/66047/8 "2004-10-02T06:07:45Z")

</div>

> The only problem I can forsee with tiled landscapes is that I’m restricted to certain shapes, and the smaller it gets, the laggier it gets.  
> do u mean the smaller a tile gets the more tiles u will need so this means laggier? of course this is true but depends on how many tiles u want to see if actually creates a problem. That sword of mana game would have been made with tiles, infact most games are, all those except with flash and some sloppy 3D game makers (as far as i know). The certain shapes shouldn’t restrict u, just have to have them confined in a square.  
> With an editor u might be able to place stuff like wily nily (sorry can’t think of a better expression) but there will be a lot more variables, and this will create more lag i think.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 2, 2004, 6:21am UTC](https://forum.kirupa.com/t/four-sde-collision/66047/9 "2004-10-02T06:21:22Z")

</div>

Actually, I think I’ve come up with a sollution! 😃

All I need is to check the collision of one point, and use an invisible barrier that just extends out from the graphic to a length of half the character. That way it “looks” like he’s hitting the wall, but he’s really overlapping it 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 2, 2004, 6:31am UTC](https://forum.kirupa.com/t/four-sde-collision/66047/10 "2004-10-02T06:31:09Z")

</div>

Here’s the updated version, hold shift to see the invisible barrier. Sometimes the shadow overlaps the map, but that’s just because i placed the barriers manually, and I rushed. It will all be dynamic in the end 😃
