User Tag List

Results 1 to 6 of 6

Thread: Pixel-perfect collision test for puzzle/brick games

  1. #1
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    yuigoto's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Pixel-perfect collision test for puzzle/brick games

    Hi! I'm having a bit of trouble besides AGBO (which I wrote in another thread). This one is related to the collision boxes of active objects.

    I can't get the hitbox on my test project to work properly, the objects end up overlapping each other when using "collides with", or stop 1px below the frame when using "leaves the play area".

    I tried using Pinball Movement, Bouncing Ball and the Physics engine to test collisions, but my collisions fail. The test with Physics ends up with the best results, but all bricks overlap each other a bit.

    The expectes result would have all bricks "snapping" to the grid after the collision (well, just end up in the proper place actually ).

    Maybe I'm missing something or doing something wrong?

    If anyone can help me, Thanks! If not, also Thanks!

    Will keep trying to work it out here

    Thanks if you read this! :P
    Attached files Attached files

  2. #2
    Clicker

    Fusion 2.5Android Export Module

    Join Date
    Jan 2007
    Posts
    259
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)
    Click the bricks to destroy them.

    I tried to comment the code as much as possible, but it may be a little confusing. Feel free to ask if you have any questions .

    hitbox-test.mfa

  3. #3
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    yuigoto's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Whoa! Thanks for the quick reply, the solution and comments, they're not confusing at all! Also, works beautifully in HTML!

    Will study this a bit more, using more tile types and mix it with some AGBO.

    Trying to properly finish this idea that I've been dragging since Jan/2014 (tried lots of 2d engines and never properly finished, even prototypes).

    Thanks again!

  4. #4
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    yuigoto's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just one more question, if possible. This overlapping issue is normal from CF's built-in engine? So I'll have to code collisions every time I want some precision, like this?

    Thanks!

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleMac Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Tisnart's Avatar
    Join Date
    Feb 2008
    Location
    On, Canada
    Posts
    1,030
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Would something like this: Block Game (WIP) be sort of what you are trying to accomplish?
    (this link is to a flash version...wait for it to load)

    This uses the Easing Object for the movement of the objects (No AGBO in this WIP engine)

  6. #6
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    yuigoto's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yup, exactly like that, but with a faster drop rate.

    Thanks for showing this nice example!

    I'm looking at all examples and the one @GamesterX23 wrote to cook my own version.

    This project I started in GM:Studio, then moved to coding in Haxe/OpenFl (because of porting issues). The last Haxe version (flash port) I wrote is here: Puzzle-Test.

    But, since OpenFL still has some troubles with different ports (HTML5 wasn't working quite well, Android port was crashing too much), I thought that solving those problems would drag development a bit more (and I want to get "rid" of this idea quickly, to start the next ones).

    Fusion 2.5 looks like the best place to prototype, build and properly finish this idea.

Similar Threads

  1. Perfect collision detection for bullets
    By AndyBazooka in forum Fusion 2.5
    Replies: 12
    Last Post: 8th June 2015, 08:33 PM
  2. Replies: 3
    Last Post: 10th April 2015, 12:12 PM
  3. [BUG] Pixel perfect scaling does not work in DirectX 9
    By netninja in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 12th September 2013, 03:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •