AllanR's Recent Forum Activity

  • this would be a good case for using a linked node list. every component of the circuit would be a node in the list, each node would know the ID of the previous node and the next node. (each node would also know what job it is supposed do).

    if the last node is linked back to the first node, then you know you have a complete circuit - then it is just a matter of making sure you have the correct components and that they are in the correct order.

    pinning the components together is just a visual representation of the logical connection in the node list. The example RBuster linked to at the top of this thread most likely does something like this - you have to click on a connection, then on the scissors to break a connection before you can link in another component... you should only be allowed to make a connection between nodes that have a free connection available.

  • I guess you can do it all in script, but if you have multiple instances of Text you would have to loop through all instances to pick the instance you want to update...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • TEXT objects in C3 are custom objects rendered on the canvas, not html elements, so as far as I know, you would have to send the prompt value to the event sheet using a local (or global) variable...

  • in the properties section on the left, you can disable Default Controls to make a player object not respond to the arrow keys. You would also do this for NPCs, enemies...

  • ok, I used the image of the slider, and Dop's qarp calculation. But instead of three sprite objects to define the curve, I added image points to the slider graphic where the A, B, and C boxes would go to make the curve work. I also clamp the touch X value so the circle part of the slider can't go past the ends.

    if you drop the circle and it is not close enough to the end point, it resets back to its starting position.

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

  • it is a lot harder than you would think...

    this is an old sample I made a couple years ago in C2. It doesn't seem to work with the C3 runtime, so if you load in into C3 you have to go into the advanced project properties and choose the C2 runtime.

    the project links a bunch of dots into a line and forces the object you drag to follow the line. the more dots you add. the better the curve would look.

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

    there are other ways to do this - if you have an equation for the line, then you can calculate a point anywhere along the line. Or if the curve is a segment of a circle you can use sin and cos to calculate where the blue square should be...

  • my file doesn't use Canvas - it uses an old ROJOhound function that connects line segments.

  • another option would be to use bezier curves... not as flexible as physics but might be easier to drag around and stretch as needed. See this old demo I made a while ago. the curve on the left allows you to just drag one of the end points. The curve on the right needs the blue dots to be moved to create the curve you want.

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

  • oh, Dop2000 beat me to it...

    you were very close. instead of setting the angle and distance to Sprite.X, Sprite.Y you need to set those to the previous Sprite2 instance.

    I set the speed of Sprite2 to -1200 so you don't have to after creating each instance, and I changed the origin slightly to get a better line. Plus if you press the space bar it stops the motion so you can see the line better.

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

  • not sure if this will help or not...

    for a lot of the database work I do I resize the canvas to the window dimensions so that I get a 1 to 1 pixel size. That way one pixel wide lines don't scale / get blurry.

    So, I tried similar logic to limit the canvas size. My sample project below turns off scaling, and just resizes the canvas based on the window size. I clamp the values to limit how big (and how small) the canvas can get, and re-position objects as necessary.

    I create a red dot on each touch to show that the touch coordinates are correct. If the window gets too big, the canvas size is limited - which results in a black bar on the right and/or bottom. (not sure if the canvas can be centered). C3 still recognises touches outside the canvas area, so I filter those out...

    I have no idea if this will affect performance the way you hope.

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

  • by rare cases I meant the rare time I want to have a touch apply to multiple instances and still have it stop at a certain point.

    I agree that 99% of the time you probably just want the top instance, but it only takes one extra condition to accomplish that (Pick top instance).

    here is a sample based on the drop shadow file I made yesterday. I added my touch tracker and SpriteButtons family to show how I handle picking the top instance, using a shield to prevent clicks, multi-touch and a variety of other situations.

    you will notice that if you arrange a window to partially cover the close button of another window that the close button only goes into the Hover state if the mouse is not over the higher window. And the window blocks the drag bar and any other buttons on windows below. Multi-touch is handled properly too, only one touch can select any individual button, you can hold down one button while using others, if one touch causes another button being touched to be destroyed it doesn't freak out, etc.

    The sample also uses Font Awesome web font icons just for fun.

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

  • if you are using a family, you can identify the sprite name with family.ObjectTypeName

    however, I think the issue is minification. Picking a sprite by .ObjectTypeName will work, but if you are comparing to a literal string, that might not work after minification... haven't tested it.

    I like the fact that C3 lets me decide how touches work / which instance a touch applies to. I like buttons to only execute after the touch is released. So I track all touches with an invisible sprite that tracks where the touch started, where it ends, how long it has been in touch, etc. My touch sprite tracker does have a boolean called StopClick just for rare cases like you mentioned...

AllanR's avatar

AllanR

Member since 21 Nov, 2013

Twitter
AllanR has 23 followers

Trophy Case

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

19/44
How to earn trophies