AllanR's Recent Forum Activity

  • well, the easiest way - with no math involved - would be to create an image point on the rotating sprite, and then every tick position the other sprite to the image point.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Mylon Well, that turned out to be a lot harder than I thought it was going to be!

    I was going to say just use On any Click, then Left button Released... but it turned out to be a lot more complicated to make the type of interface you want.

    So, take a look at my capx: http://www.rieperts.com/games/forum/MouseClickTest.capx

    It can tell the difference between clicking, double clicking, and click-and-drag for both the left and right mouse buttons. The scroll wheel zooms in and out to where the mouse is pointed. Having a zoom feature made it even harder to have the mouse click and drag work properly to select units...

    A double click always registers as a single click first, then a double click (if the second click happens within the threshold time, and within the threshold distance of the first click). That is pretty universal how mouse events fire. If you really wanted a double click to not count as a single click first then you would always have to wait until the threshold passes before you could process a single click. So, factor the order of events into your UI design. (a single click should select a unit, a double click would then select the unit and allow a secondary action to happen).

  • RamPackWobble Thanks, but you did half the work - I used your capx, your objects, and sine settings. I just flattened the pendulum into a line and made it work in response to mouse input rather than on collision with the pendulum...

  • I would create a sprite object with a one frame animation for each card in the deck. Then create an array that can be "sorted" to randomize the deck. To deal a card, create an instance of the card sprite and set its animation to the corresponding next value in the array...

  • I just worked on a similar example for someone else last night: http://www.rieperts.com/games/forum/pendulum.capx

    right-click on one of the brown squares to swing from it...

  • I helped someone with a very similar question over a year ago. Here is the capx of the sample level they were after:

    http://www.rieperts.com/games/forum/Wall-Tracing.capx

    not quite the same smooth curves you asked about, but close...

  • Miari

    I modified RamPackWobble's capx to do what you wanted. There were a number of tricky things to handle to make it work properly - like what to do if you release the player while he is in the middle of a platform, being able to handle multiple spRef points, I had to add a small Wait because Construct2 occasionally flashed the player at the wrong point along the arc.

    http://www.rieperts.com/games/forum/pendulum.capx

    There are no physics involved - so the pendulum action never slows down, and there is no momentum when you release the player... but other than that, it works well.

  • I am not sure what you mean by "stops working" but if you mean that the text does not appear then it could be that the text box is not big enough for the size you are setting it to. So, try making the text box bigger.

    I know when I test on my iPhone, text boxes don't display properly if I am zoomed in too far, so that could be a problem too.

    I only use text for debugging - using sprite font is a better way to make sure text looks the same regardless of browser or platform used.

  • Welcome to the community! : )

    Construct 2 handles sprites of all sizes very well. You can group sprites into families, so that rules, functions and game logic apply to a wide range of sprites without duplicating code.

    You can turn pixel rounding off, if you want. And there are many options to scale things to get your game looking the way you want.

    Every sprite has its own collision polygon - so I don't think you will have any trouble there.

    There are lots of tutorials, and examples to play with, and the community is very helpful.

  • Well, as Ashley always says - the best way to know for sure is to test it out and measure the difference. If you are targeting mobile, then I would avoid physics if there is any other way to do something (and there almost alway is). Although, for the very short time a weapon will take to fall to the ground, it may work just fine. Platform behaviour would probably have less of an impact on performance, but I don't think the weapon would fall flat on the ground as realisticly without some manual coding.

  • The canvas plug is a great way to do it.

    Athough you can also do it with sprites. Make a sprite that is a short line. set the origin at one end of the line. Set the sprite's position to the first x,y coordinates you want to plot. set the angle of the sprite to the next x,y coordinate, then set the width of the sprite to the distance between the two points - using Distance(x1,y1,x2,y2).

    You can see an example of plotting lines like this in the 3d star map tutorial I did last year. https://www.scirra.com/tutorials/774/3d-star-map. Click on a star, then click on another one... The capx is available to play with.

  • Results like that are common when dealing with floating point math.

    In the line where you increase Health you can: Set Health to Round((Sprite.Health + 0.2)*10)/10

    That will round to one decimal place.

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