Problems selecting and moving new sprite instances

0 favourites
  • 2 posts
From the Asset Store
Kids Game
$49 USD
New Sounds Added Update: 115 new sound effects added for no additional cost!
  • Hi all! I'm making a grid based match 3 game. But I'm running into a problem. I set up my events so that every time I click my left mouse button 1 of 3 colored matchable sprites that I put in a family spawns at a random tile on the board. Now the problem is that I can't control any of the new spawns. The only ones I can control are the first spawns of each colored sprite. I'm using the Astar pathfinding plugin by the way for grid based movement. Is there any picking expression or something that will allow me to control any sprite I want whether it was the first yellow colored cube on the board or even the 100th yellow cube instance for example? I just want to click on the sprite and then click where I want him to move. Like I said I can do this but only on the first instance of each sprite.

    I've been trying to fix this on my own for a few days now with no luck... Maybe it's just some easy form of "pick" or expression string that I'm not familiar with. I would really appreciate it if any of you smart people could help me with what would seem to be a deceptively simple concept. Thanks very much in advance for your time and advice! <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi, still trying to find a fix to the first problem... But while doing so I have found two new problems with my game. The first new problem is that none of the new instances of my sprites retain their path-blocking value when spawned, even though according to my very first event they should all block paths. I'm confused on this very much. Is it a problem with the plugin or my event logic?

    For the 2nd new problem I made this event to spawn new instances of the colored cubes at random slots on my board:

                

                 Condition1: On any click:

                 Condition2: System, Pick a random "Tiles" instance:

                  -Action: System, create object "Family1" on Layer 1 at (Tiles.X, Tiles.Y)

    This event does indeed spawn a random colored cube at a random slot but sometimes they spawn on top of each other! Is there a simple way to fix this?

    My previous post didn't seem to get any replies, probably because no one could visualize what my events and problems were, sorry for that. So I made a cleaned up version of my test game for you to download. It's just basic but hopefully some of you C2 Vets could help me with my 3 above mentioned problems. Thanks again for your time and help, here is my .capx https://www.dropbox.com/s/rn5fe65d3jhdksn/PathfindingTest1.1.capx

    And the Astar pathfinding plugin/Behavior that I used is here https://www.dropbox.com/s/bi08pg8eyjpozqw/astar_all_1.0.zip

    Have a look and thanks a bunch!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)