Page 1 of 1

Collision detection plugin

PostPosted: Sat May 01, 2010 11:37 am
by juhuwoorps
After a sleepless night, tons of cigarettes and a lot of frustrating moments I was able to make the Collition detection plugin.
I have made this plugin for puzzlegames like the slider puzzles where you have to move out a tile from box.
The plugin is easy to handle, but it have some limitations at the moment:

- The first hotspot you set, the small site of the hotspot sets the size of the movement.

- There are limitations for the hotspot sizes and coordinates:
the small site of the hotspots has to be dividable by 2 and the long site of the hotspot has to be a multible of the short site.
For example:
If you have a lenght of 50px for the short site, the longer site must have a size of 100(*2) or 150(*3) or certainly 50 (*1)

If you have a lenght of 6px for the short site, the longer site must have a size of 12, or 18, or 6 ....

-The hotspot coordinates of top and left have to be dividable by the short site of the hotspots

This sounds a bit difficult, but as when you run the demo for this plugin you'll see what I mean and you'll see that it's easy to handle.

If you have placed your hotspots well, just activate the plugin on each hotspot and select the allowed movements.

Zhe zip file includes the plugins and a projectfolder with the demogame

I hope this plugin is helpful for your game creations and I would be glad to see some minigames with this plugin!

Oh, please note: If you have activated the plugin in a hotspot, it detects collitions to all hotspots in the frame!

Have fun
greetings juhuwoorps

PostPosted: Sun May 02, 2010 10:36 am
by Lyberodoggy
Lyberodoggy's Old post wrote:Thanks! :)
I 'm gonna test, tweak and provide feed-back within the next few hours.

EDIT: I 'm working on the code already. Trying to fix some things

here's an updated version. Please don't use the join feature as it is still under development and doesn't work properly yet.

In the updated version some code has been deleted as it wasn't needed, a bug concerning an unregistered variable was fixed and hotspots collision detection can now work even if hotspots aren't on a grid or the same size.

PostPosted: Sun May 02, 2010 10:56 am
by juhuwoorps
Sorry but your modification doesn't run properly.
Sometimes I can't get the hotspot to move, although there should be move possible. Also the movement of the full size of the longer site isn't good to make puzzle.

Can you say which variable wasn't registered?

PostPosted: Sun May 02, 2010 12:49 pm
by Lyberodoggy
I think it was the all_hotspots

Found the bug too. I 'll try to kill it.

Re: Collition detection plugin

PostPosted: Sun May 02, 2010 1:24 pm
by Mystery
juhuwoorps wrote:After a sleepless night, tons of cigarettes and a lot of frustrating moments

If you add 10 cups of espresso, then it could be me finishing up a game :lol: :lol: :lol:

Thanks for all your work juhu! :D

And I like the co-operation on plugins with fixes and further developments Doggy :)

I'll have a look at the plugin when it's fixed, I'm curious how it looks like - is it easy to use?

PostPosted: Sun May 02, 2010 4:42 pm
by juhuwoorps
I have updated my first version of the plugin because I had some issues as I tried to make a demogame with the plugin.
I also added a second plugin where you can set your escaping variables in the frame properties.

The zipfile includes both plugins and the project folder with the demo game.

To help you with setting the hotspots to the rigth place I have made another plugin!
At my personal opinion it's neccesary for this sort of minigames, that you have your hotspots at the right place so that you all can get smooth and well working.
But placing HS in AM can be a ****** work.

I have made this plugin special for the slider puzzles which are able with the collition plugin, but i think you will have also a need for other stuff.

Ok Let' see how it works:

This is a picture of my frame out of AM

You see the hotspots are messed up.

If you now test your frame. you will see something like this:


It's the same as in the editor!

If you are using the automatic_hs_placement plugin in the frame properties it looks like that:


Hope this helps you with your games :)