Bartosh's Recent Forum Activity

  • So what exactly are you trying to do? something like the puyo puyo game you brought back from the dead? It would be a radically different system than say, bejeweled.

    Plus there's normally always more than one way to solve a problem, and the best choice is based on context.

  • how about you set the simulation steps to 0?

    apparently that's a thing.

    I used to use the physics object all the time, now i always just make my own custom physics, i couldn't stand the quirks of it anymore.

  • start a dev log so i can fallow it, this looks awesome.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • kinda a tall order.

    the long answer:

    ---------------------{array alighnment}--------------------------------

    you need to align everything to a grid, something like 64x64

    then set a value 'Tx' (so tile x position) and 'Ty' for your object

    always set those value to

    Tx: round(.x/64)

    Ty: round(.y/64)

    this will give you your x and y position in your array.

    have a similar process for all your objects (maybe just put them all in a family so you only have to do this once?)

    -------------------------- {Moving}------------------------------------

    always,

    for each object:

    • >set position array ('Tx','Ty'+1<-(or whatever),2)too object .uid

    then when an object want to move in a given direction

    check that spaces Z2 position, if that position is equal to 0, go ahead and move.

    but if its not

    • >add parameter: value at array position (the tile being checked,z2)
    • >add parameter: oject value'Tx'
    • >add parameter: object value'Ty'
    • >call a function "swap" forgetting objects(this is just to make sure the program forgets the current object)
    • > move to space ( it will be clear, because the funtcion will have taken care of that.)

    on function "swap"

    object uid = 'paramiter 1'

            -> move to( parameter 2, parameter 3)

    ------------------------------{checking}--------------------------------

    as far as checking the fastest method(in terms of cpu speed) is manually so:

    is position at array(Tx+1, ty,2)

    however this can be time consuming to write, and a little messy to read.

    so the other method is to check using Modulo [ the symbol %](for and extended explanation go to Tulamide's little corner)

    but for or purposes it will be calling a loop 4 time's and checking the value of:

    .Tx + ((loop-2)%2)

    so -1,0,1,0

    .Ty + ((loop-1)%2)

    so 0,-1,0,1

    -----------------------------

    so in you script it would look like

    on loop "check"

    array position((.Tx + ((loop-2)%2),(.Ty + ((loop-1)%2),2)=0

          than do the stuff we talked about.

    --------------------(Replacing only if it has too)--------------------

    so i take it you want the object to only replace something if thats the only thing it can do?

    this would be a mater of how you organize you events.

    when the objects ready to move, set another value in it like 'moveme'

    to 1

    for each object     

    value 'moveme' = 1:

       - call loop "blank search"

    on loop "black search"

    - preform the search mention above and if something matches what its checking.

       -> move the object

       -> set object 'moveme' to 0

    than another event after the first (beacuse its after the first, it will only happen if the value move is still equal to 0)

    for each object     

    value 'moveme' = 1:

       - call loop "swap search"

    on loop "swap search"

    - preform the search mention above and if something matches what its checking.

       -> do the paramiter switching function thing

       -> move the object

       -> set object 'moveme' to 0

         

    _______________________________________________________________________       

    for some more advance moving and checking in arrays

    Array A*

    you can ignore the actual A* part, and just look at how it checks,

    ______________________________________________________________________

    I just did this of the top of my head, it should work, but i would need to see your specific case to know for sure.

    --------------------------------------------------------

    so the short answer too your question :

    "Is there a simple way to check to see if any spaces around an object are empty and move to that space; and if they aren't have the two objects swap positions. "

    ...no..

    (unless somebody made a plugin)

  • odd, dose every thing go excessively fast if you turn off frame limit?

    maybe , in the physics behavior, change the simulation steps too 1?

  • Hellcube@

    the page was loading slow, so i only saw the top of the image, and i was like" what the....? how is that even possible?"

    then the rest loaded, and i couldn't stop laughing.

    no offence

    it sounds like it will be cool, like area 51 or something.

    and i think NS2 is awesome. so i see were you coming from

    i'd like to see a video.

    i think it would do more justice to you project.

    but still. that was funny.

  • custom physics yes,

    but i thought the physics object was automatically adjusted for deltatime.

  • ok failure to communicate, my bad.

    the events with the new global values shouldn't be sub events, just regular events.

    and your clear events was happening after you load from array, so it was immediately being filled with 0.

    but to make this point again, the array function ,clear to, does nothing, if your just going to load onto that array. for you project, it would only be useful for a "new document" purpose.

    were you actually want the screen cleared.

    dropbox.com/s/g768rt3nd03pf1h/fixedarraysave.cap

    here's the fixed .cap, every thing should work fine as far as saving and loading arrays.

    but if it doesn't, let me know.

  • Helladen

    Nah, I Know, I was just being a smart-ass.

    (for the moderators, i mean a donkey, not a butt)

    ---------------------------------

    facecjf

    An inspired uplifting post/perspective.

    ---------------------------

    DrJones

    that's a very good plan, anybody telling you otherwise is wrong/ just wants your allegiance ( or money )

    just don't become too reliant on CC.

    as far a pixel perfect collisions in C2, you could map every pixel to a spot in an container array, and check the overlap of each spot. it'd be a nightmare to initially make, but i bet it would work.

    (At least it would in CC, I've made a custom build 32 bit ship sprites using a similar process before.)

    (Arrays are awesome.)

  • that's why there coding the next gears of war in HTML5

  • whoops ...I forgot to tell you last time

    the two points in the name is happening because in the first event,select file extention thing, you have ".cwm" as the extention, change that to just "cwm", it automatically adds the dot.

    but you don't even need an extension for array files, it just helps with sorting.

    I'm at work right now, I'll have another go at your .cap this evening.

  • Is this a tile map?

    if so

    are your tiles mapped to an array?

    if not, i recommend you do that. The most advance tasks you can preform in construct use arrays ( or super structures, if you get the plugin).

    and its almost critical to working with tile-maps.

    ------------------------------------------------------------------

    if not,

    assign the tiles in a group a variable, like ('number')

    give all the tiles in a group the same value 'number'.

    then on a event

    using the function object

    "Chgmt" is overlapping "Tile" at offset 10(or whatever):

        ----> add parameter tile.value('number')

            call function("pick") forgetting objects

    on function "pick":

        - for each tile

        - tile 'number'= parameter 1 :

                          ---> change color.

Bartosh's avatar

Bartosh

Member since 20 Sep, 2007

None one is following Bartosh yet!

Trophy Case

Bartosh has no trophies yet!

How to earn trophies