AllanR's Recent Forum Activity

  • good for you for trying! there is a lot to learn... so keep trying.

    it is a lot easier to help if we can see your project. So you should look into getting dropbox.

    something in your code is trying to restart that one animation but impossible to say why without seeing the code.

  • glad to help.

    You are correct about the DradDrop events only affecting the instance being dragged. In C2/C3 understanding how instances are "Picked" is a very common stumbling block, but once you get your head around all the nuances, you can do some pretty amazing things!

    You can refer to the picked object as "self" to access the objects properties. Which comes in handy if you have several instances picked, you can say "Set Objects.x to self.X + 50" to make each one move relative to their current position...

    I use instance variables a lot! it keeps all the relevant data with the object. The alternative would be to look up data stored in an array or something, which can work just fine too. If you have multiple objects and want to sort/arrange them, you can put them all in a Family and give them a code stored in an instance variable to make them do what you want - rather than giving them a name with some code tacked on the end (although that can work fine too - just whatever makes the most sense to you).

    The DragDrop events are Triggers, which means they only get processed when an instance triggers those events. I used Touch rather than Mouse so that my example would work just as well on a phone or tablet. On touch devices you get multi-touch, so two people could be dragging around objects at the same time, and the event sheet will only apply the actions to the correct instance selected. Even if two objects were dropped at the exact same time, each one would trigger the Drop code and only apply the actions to the instance that caused the trigger.

  • have you looked at the Space Blaster demo game? it uses touch and pretty much moves like the game you linked to as far as I can tell. Space Blaster seems a little slower but it isn't hard to change the ship's speed.

  • definitely not a limitation of C2! There are probably great number of ways to achieve what you want, so I thought I would take a quick crack at it...

    I used an array to randomise the order (without getting any repeats). Each answer needs to go to a specific image point on the background image. So, when the player drops an object, it checks how close it is to the desired image point.

    I did it as generic as possible, so it will work with any number of objects - just change the frames of the Objects sprite, and the global variables at the top, and the background image. (You have to set image points on the background image for where the answer boxes are and then use the ImagePosition global variable to tell which Objects frame goes to which image point).

    https://rieperts.com/games/forum/Garden.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • here is a really quick test...

    it give the ship Bullet behavior, and sets the speed based on the distance to the place you touch. And updates the speed every tick so it slows down as it gets there. And sets the angle of the ship to the target coordinates.

    https://rieperts.com/games/forum/SpaceshipToTarget.capx

  • that would be a pretty complicated collision mask... but it should work.

    an alternative would be to make simpler cloud shapes, and then combine several to make up a cloud that looks like that - an if you randomise it, you could get different clouds each time.

  • here is a quick sample:

    I gave the family an instance variable to tell the objects apart, but there are other ways too...

    https://rieperts.com/games/forum/PickTop.c3p

  • what I do in similar situations is put all the objects in a family, and then when checking for touch, use the family and pick the top instance. Then if it is an obstacle, just ignore it.

  • I had never seen that game before, so I played an on-line version... it was quite fun! :)

    you will probably need to keep the board pieces in an array, for checking if a move is valid, if there are any moves possible, and reshuffling the board when necessary.

    Since after every player move you need to make sure there is at least one move possible, the only way to do that quick enough is looping through an array - definitely some tricky programming needed there! I would love to take a crack at it, but don't have time right now...

  • Choose is a great option. If you use random, remember to round off the number - although that can make the first and last numbers in the range more or less likely to get picked depending on how you round.

    If you want to repeatedly pick numbers without picking the same number twice then put the numbers in an array, pick a random array element, and then remove that element from the array.

  • but if you are dragging and dropping, what would stop someone from doing circles to run up the distance? or just go back and forth? The actual distance should be the starting point to the end point, without all the extra movements.

    you could do your own custom drag and drop, and calculate the distance moved every tick if you really needed to.

  • you might have to give the object an instance variable to manually calculate the distance travelled.

    so, on Drag Start you could save the starting position, and then on Drop calculate that distance and add it to the object's variable.

AllanR's avatar

AllanR

Member since 21 Nov, 2013

Twitter
AllanR has 23 followers

Trophy Case

  • 11-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

20/44
How to earn trophies