AllanR's Recent Forum Activity

  • first of all, there is no harm in having Touch in there. I am used to using it so the same code will work with a mouse, without a mouse, touch screen, tablet, phone, whatever...

    if you don't have any instances on the layout at the start, then you don't have to worry about disabling the SetColor. If there were instances, then by default, they would look like they are selected...

    in the code you posted, you are checking if the mouse is over Rocks, but in the subevent you are switching to All_Objects, then filtering those to only ones already selected. so you aren't adding anything new to the selection.

    you can get rid of the subevent, and just set Rocks.Selected to true, and enable its SetColor.

    if you have SetColor defined at the family level with the color you want, then you don't have to worry about changing it in code - just enable and disable when selecting and unselecting objects. (unless you want different objects types to have a different selected color)...

  • in the rocks.capx file I made, I added a boolean variable on the object family called "Selected". That is used to know which rocks to drag and drop. you could use that variable to know which objects to modify with your popup menu. that way you could select a bunch and have them all rotate/grow/shrink/etc at the same time... or just click on one to "select" it...

    if you don't want people to have to click to select, then when you right-click over an object, set its UID to a global variable so you know which object to apply any changes to.

  • well, curiosity got the better of me...

    here is a C2 project that can select multiple objects and drag them around...

    it uses my standard multi-touch routines, so it works with mouse or touch. (but I didn't add any logic to prevent you from using a second touch to mess with your selection/dragging)

    you can use CTRL to add or remove objects from the selection... seems pretty bullet-proof, and works the way I would expect.

    https://www.rieperts.com/games/forum/rocks.capx

  • it isn't that pick all isn't working...

    he wants to place a number of objects in his layout, and then have the ability to select a bunch of them and drag them as a group. The drag and drop behaviour will automatically pick the top object and just move that one instance.

    so he needs a expand the functionality using the pin behaviour or making his own custom drag and drop routines...

  • there is no easy way to Drag All. If you use the Drag and Drop behaviour, you would have to have a system to select all the ones you want, and then on Drag Start, pin all those objects to the one being dragged. Then unpin them on Drop. (which is what my quick example above sort of does, but there are plenty of issues that would need to be fixed).

    the other option (which I would probably do) is not use the behaviour and make your own manual drag and drop system... which I have done a couple times, but not quite for what you are doing...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • you can add another condition to mouse over rock, and choose "Pick Top/Bottom" (it is way down at the bottom of the add condition window).

    I made a quick test to select and move several objects at the same time...

    it is not nearly complete, but shows one approach - but if you are not a programmer, then it will be tricky to make it fully functional. If I have time I might work on it some more in the next day or two...

    https://www.rieperts.com/games/forum/rocks.c3p

  • he had tried that earlier but it wasn't scaling evenly...

    to make it scale evenly without using an instance variable you can do this:

    EDIT: I guess I should have refreshed the screen, but the code above should work fine...

  • Alon

    you have to increase the Size variable. Since it starts at 1, and you don't change the variable, your code will always set the scale to 1.01

    on mouse wheel up, add 0.01 to the Size variable, then set the scale to Size.

  • well, that looked like fun, so I took a crack at it...

    you only add the Touch object to your project once, and that allows for multi-touch. So, you only need one TouchPoint sprite object to track each active touch.

    but you do need a way to tell which side the touch started on, so I also created a PlayArea sprite so that touches would know which player they belong to.

    each touch get assigned to the play area they are initially over, and that is used to select the correct energy bar, score instance, etc...

    the ball speeds up every time a player hits it. there are variable for how long the game goes for (5 right now), how many paddle instances a player gets before their energy runs out (30), how fast the paddles shrink, how much the ball speeds up, etc...

    https://www.rieperts.com/games/forum/touchinput2.capx

  • margins are only used in the C2 editor to show space around the layout so you can place objects off screen.

    setting your layout size to 117,49 means your game screen is 117 pixels wide and 49 pixels high. that is a tiny (on a screen that might be 1920 x 1080) !

    choose a more reasonable layout size... then under project settings you will want to choose letterbox scale, or maybe scale outer. there are tutorials and plenty of examples in the forums on how to set up for different screen types.

  • beta r158 added the ability for the browser object to load a css file. I haven't tried it, but that may allow you to do what you want...

  • I fix a couple minor bugs and added a slider to try different card flip speeds...

    you can re-download it from the link above.

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