RandomDood's Forum Posts

  • Cool It works. Now all i need to do is figure out a way to group the objects if they are matching and I'll be done.(mostly) Kind of like:

    scirra.com/forum/picking_topic62950.html

    but updating each block to a group in real time.

    Edit: This is possible right? It would make me feel better knowing I have just be doing something and not something impossible.

    Update: Finally figured out something that works. Its not perfect but at least its something.

    Thanks again for your help.

  • Both of you helped me out a lot. I am actually going to see if I can use both of these. I'm an artist and not very good with programming so R0J0hound's example is a bit easier to understand. But I do have some basic programming knowledge and experience with arrays so I have an idea how I can use arrays to add in a bonus feature I have been thinking about.

    I may have more array questions down the road though.

    Just out of curiosity, does it make a difference when using either an object focused "coding" or an array/programmer focused "coding" in construct 2 and or classic? Is one faster than the other, less errors, less processor heavy, or more optimized?

    Thanks again

  • Thanks to both of you for the help. (And I forgot to thank Bartosh for helping me with a post a long while back so thanks again.)

    Assuming that either of you guys come back. I had questions for you both:

    R0J0hound: I understood your flood fill example up until action #5. I don't understand why the detector doesn't check other sprite separated by the gaps while having a pick all sprite action. Also didn't get how changing the size to 32x16 for horizontal and 16x32 for vertical makes a difference for an overlapping check when the sprite is 32x32.

    Edit: Tried in CC. Unless I did something wrong it wont work. There is no system pick all objects so I tried substituting it with pick by comparison "animationframe" = #

    Bartosh: If I understand your A* example correctly you use a 3d array to store multiple variables for objects in the same space am I correct? So going with the Puyo Puyo example, I am guessing that I would:

    1) Check to see if a color block/blob is moving and if not, search for the array coordinates that correspond to the block's position. Maybe set some PV for the block to stores which array it is representing.

    2) Set array (x,y,Z1) to represent the color of the block,

    3) Run an array loop and check to see if the colors next to it match.

    4) Set array (x,y,Z2) to represent a pseudo var "match"

    And probably a lot of other things I can't think of right now.

    I would say my biggest issue is figuring out how to match individual blocks, group them together without their values bleeding into other groups, and mark specific groups for destruction. The grouping is important because in most games like this, the score bonus is dependent on how many matches of a group of colors you get. So if I get groups of (6 red, 4 blue, 3 red) the score bonus would be something like (x6, x4, x3). -> calculate bonus then destroy each group.

    Thanks again for the help and I think I'll take your advise and post in the C2 forums and transfer my issue back to CC from now on.

  • I am trying to do something like the Puyo Puyo game yes. I originally thought the two where pretty much the same. But Puyo Puyo has a more appealing and dynamic realtime matching system.

  • I found this old thread while looking for a solution to my problem. I'm interested in it but a lot of these old threads are dead and links don't work.

    I curious if anyone has succeeded in doing this. I interested in the matching and linking of multiple colors/slim things more than chain combos, but I assume that goes hand in hand.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I am using an Array to create a play field. I want to see if objects on the field are arranged next one another in different patterns that I make. Can I make a .txt file or something like that and have the array read it to see if objects are arranged in that pattern? Is there a better way to do this with or without using an array?

    Bonus question, but not really my focus.(yet) How would I go about being able to check and see if the objects in question are matching either by animation frame or multiple instances of an object?

  • Wow. Thank you for that. I honestly did think that it was a simple problem. I'll give this a shot.

  • 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.

    I'm trying to do this on a grid system using an Array and the object themselves have a grid behavior to make movement easier.

  • Is there a way to check to see if all the values in an array are the same in classic?

    Or check to see how many have the same value?

  • I'm trying to build a grid system in code (invisible grid) and thought an array would be the best option.

    I wanted the array grid to change values (0 = false, 1 = true) if an object was covering those corresponding potions on the game field.

    I tried a few variations of:

    Start of Layout

    ->Set Array size to X=layoutWidth/gridsize Y=layoutHeight/gridsize

    Fox "x" from 0 to layoutWidth/gridsize

    Fox "y" from 0 to layoutHeight/gridsize

    --If object is over gridsize*loopindex("x"),gridsize*loopindex("y")

    ->Set Array Index (loopindex("x"),loopindex("x")) to 1

    --Else

    ->Set Array Index (loopindex("x"),loopindex("x")) to 0

    But the array just wont recognize if something has been placed over the corresponding coordinates.

    Can I not use the array this way?

  • That makes the debugger kind of useless for arrays doesn't it?

    Is there other way I can check the values in those positions that wont show up?

  • I apologize if this question has been asked before.

    I am having trouble with the array object. I put values in (X,X,1) for a 2D array, but when I debug all I'm getting are the values for the first set of numbers like its a 1 dimensional array (X,1,1). I don't understand why.

  • Awesome. It works perfectly.

    Thank you <img src="smileys/smiley36.gif" border="0" align="middle" />

  • Ah, I understand. This should be a lot simpler now. Thanks.

    Also this should have been my first question, but how exactly do I use the mask effect? When I apply the mask I have this giant black void around it and I get this permanent image echo effect for anything that moves around in the black.

    And is there a way to invert the mask?

    Edit: If I make the mask dynamic (having it move) it acts like a paint brush, undoing the rest of the mask. (that's not really my goal)

  • Is it possible to mask off part of an image, and at the same time change the collision mask so the part that is visible can still be collided with, while the part that is now invisible can not?

    Or at the very least is there a way to create the same effect?

    P.S. Trying to do this during run time.