DesktopX Object Collision detection
Sunday, September 25, 2011 by Skarny | Discussion: DesktopX
edit: I've reworded this post and categorized under DesktopX - I'm hoping to spark some interest from DesktopX developers.
For fun of course!
Using dxCanvas by LittleBoy we have access to a flexible in memory image map within DesktopX.
This opens up a number of collision techniques used often in simple game development.
I've done some testing and created some videos and interactive DesktopX objects to experiment implementing these techniques.
I'll keep updating the list below and hopefully get some discussion going from interested DesktopX developers.
What would this be useful for? Maybe small DesktopX based games? Better object/object interaction?
I for one will be trying to get a couple small games out.
All files are in my public skyDrive under the dxCanvasCollisions:
https://skydrive.live.com/redir.aspx?cid=ff1faf74706c5bbc&resid=FF1FAF74706C5BBC!152
- collision.swf - pixel based collision which respects alpha channel of objects - uses dxCanvas overlay masking
- collisionDemo.exe - a shoddy but working interactive DesktopX gadget - rectangle based collision
- collisionDemo2.swf - pixel based collision - uses dxCanvas pixel lookup methods
Hope this sparks some interest/new ideas.
Reply #2 Monday, September 26, 2011 2:09 AM
Bounding box collisions are easily doable in DesktopX.
But sometimes pixelbased collisions are useful for games - or other image-image interactions.
DesktopX has no way of doing this, except now with dxCanvas I can use the in memory rendering methods it exposes to rapidly do image composition.
dxCanvas also exposes a pixel array which lets you check every pixel in a range for a particular colour combination.
It's really a 'tech' demo - to show it can be done in DesktopX without it being too slow and useable.
There's an 'interactive demo' now called 'collisionDemo.exe' on my skyDrive - I just cobbled it together as quickly as possible to test some collision methods.
It also doesn't demo the pixel collision too well, sometimes the collision occurs before the 'draw' of the object and it looks like box collision is all that is at play.
Maybe you'd like to make a DesktopX game RND?
Reply #3 Monday, September 26, 2011 8:28 AM
Well, I might....If you can get this hillbilly mind to understand, lol.
Reply #4 Monday, September 26, 2011 7:32 PM
That's fantastic. I had some ideas for pixel-pixel collision once. My problem with dxCanvas is the need to turn on UAC on Vista, but this is definitely worth exploring.
Reply #6 Wednesday, September 28, 2011 6:44 PM
I remember the original version had problems working on certain computers (with UAC off), but I thought I fixed it a long time ago. Are you still having problems with it?
Reply #7 Wednesday, September 28, 2011 8:24 PM
Yeah, no go with UAC off. Nothing shows up. First error in the stars script, for example is canvas.width is null. Once I turn on UAC everything works fine. (But I dislike UAC.)
Please login to comment and/or vote for this skin.
Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:
- Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
- Access to a great community, with a massive database of many, many areas of interest.
- Access to contests & subscription offers like exclusive emails.
- It's simple, and FREE!







Reply #1 Monday, September 26, 2011 12:56 AM
Ok, I saw it, I don't get it. But I can be a tad dense at times....shut up Yrag.