User Tag List

Results 1 to 4 of 4

Thread: Object instances stacking problem

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export Module
    Arcanacra's Avatar
    Join Date
    Mar 2014
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Object instances stacking problem

    Hello.
    I have problem with working with ForEach loops and collision detection for many instances of the same object.
    I'm trying to make a game where randomly generated tetris blocks fall from the top to bottom, litter the level, stack on each other and are removed by players, causing other tetris blocks which were on that block to fall. Considering it's a tile-based game, all blocks which are not obstructed by anything, will fall tile down.
    I'm trying to figure out simple way to keep this mechanic to work, and I just can't. At my best attempt blocks were indeed detecting collisions (thanks to masks) with each other and bottom, but game went more and more laggy because of big number of objects (due to number of masks - each block had one), and removing masks caused the blocks to go bananas.
    I tried using both foreach loop and fast loops but I can't figure out how could I use them efficiently, tutorials and instructions just don't help much. I couldn't find any tutorial specifically about stacking many instances of the same object on top of each other (for tile-based game of course). All I achieved so far is frustration and sanity loss :I

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleSWF Export Module

    Join Date
    Jul 2006
    Location
    Norway
    Posts
    333
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could use the physics object for this.

    I have attached an example.
    Attached files Attached files

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export Module
    Arcanacra's Avatar
    Join Date
    Mar 2014
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for reply, I appreciate any will to help.
    I have considered using built-in physics, but unfortunately, they aren't really trustworthy, if you mean to work with pixel perfect collision detection.
    Also hitboxes may be inperfect, which leads to stuff like this:
    6db15fbfcd.png
    Some of the blocks seem to hang in midair.
    Also objects powered by this physics engine tend to be wibbley-wobbley (contraptions tend to move slightly to sides, when new objects fall on them).
    Tiles are going to be 16x16 pixels in size, so that means all blocks will be moving down each 16 pixels, if nothing blocks them from that, and same goes to x coords - i.e. block can be x=16 or x=32, no inbetween. That + physics engine might also cause blocks to go through each other/backdrop on the bottom, and I want to avoid this :S

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export Module
    Arcanacra's Avatar
    Join Date
    Mar 2014
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Big update, sorry for double posting.
    I have managed to do this!
    Thanks for people who replied to my problem both on forums and Converse thingy!
    Here's the example of what I meant. You can control the Mole by cursor arrows - walk into blocks to eat them, if block falls on Mole, Mole dies. Also you can click blocks to remove them.
    Mole still can get out of bonds etc. but it pretty much shows core gameplay concept
    Kret Ostateczny.mfa

Similar Threads

  1. Replies: 15
    Last Post: 2nd October 2015, 10:31 AM
  2. Object order problem with multiple instances of the same object
    By tom79 in forum Multimedia Fusion 2 - Technical Support
    Replies: 14
    Last Post: 1st November 2011, 06:38 PM
  3. a solution to a stacking problem
    By GeorgeD in forum The Games Factory 2 - Technical Support
    Replies: 0
    Last Post: 27th September 2011, 09:44 PM
  4. a solution to a stacking problem
    By GeorgeD in forum File Archive
    Replies: 0
    Last Post: 27th September 2011, 09:40 PM
  5. Stacking instances of an active object?
    By Fisholith in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 24th November 2007, 12:27 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
  •