cjbruce's Recent Forum Activity

  • I do, but maybe can update the links?

  • You are looking for the AJAX object. It allows GET and POST requests:

    https://www.scirra.com/manual/107/ajax

    In my experience, there are 2 gotchas:

    1. Remember to properly escape any quotes "".

    2. The format for sending POST data is the same as for GET. In the C2 manual it says:

    [quote:2grndpef]Post to URL

    Send a request with data to a URL and retrieve the response. A tag is provided to match it up with the On completed, On progress and On error triggers. Construct 2 does not automatically URL encode the post data - use the URLEncode system expression to ensure the data is in the correct format for posting. Note post data is in the same format as a query string, e.g. "foo=1&bar=2". The method can also be specified: by default it is POST, but for some APIs you may need to change this to PUT, DELETE or another HTTP method.

  • That's not a good solution, even though it'll work in this case (since you only have 50). With larger sizes you'll endlessly hang the cpu as it regenerates and checks the numbers. What you need to do is store all your numbers in a list, (1,2 ... 500) pick a random index from the list, and return the number at that index. Then remove the number at that index from the list and repeat. This way the operation completes in a known time.

    +1 to this method. It is nice and simple.

    If you aren't comfortable working with arrays, you could even do this with sprites to which you have assigned a number for the instance variable:

    1. Use "pick random instance", store the number assigned to that instance in an array, then delete that sprite instance.

    2. Repeat until all of the instances have been destroyed.

    I recommend learning how to do this with arrays though, as creating sprites for the sole purpose of destroying them is kind of wasteful.

  • fuego96

    How did you design and place objects for the track? Was there a lot of trial and error?

  • fuego96,

    Well done! Its good for poeple to see that you can get great performance out of 3D WebGL. Now if we could only convince people that a 3D viewport is worth it! 😊

  • Ah. How are you controlling the puck? Possibly with the Drag-and-Drop behavior?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You don't have control over their cache, but you can recommend that players use "Incognito Mode" (Chrome), "Private Browsing Mode" (Safari), "InPrivate Mode" (Microsoft Edge), or similar to prevent caching altogether.

  • The easiest way is with the "Physics" behavior, which is designed to do this specifically. Just remember to set world gravity to 0 so that objects with physics behavior don't automatically fall to the bottom of the screen.

  • I have paid for a subscription to support Scirra, but can't switch at this point because I rely on C2-only plugins.

    I love having the ability to work in Mac OS, but my two major projects will probably never be ported.

  • Great data points. Thank you for sharing!

    My largest project is currently at 4500 events. No issues so far.

  • R0J0hound,

    I've been a fan for years, but haven't seen this thread until now. This, and pretty much every other insightful comment you make, should be stickied for posterity.

    Thank you, thank you, for this wonderful treasure trove!

  • You could do this with the platformer behavior + a little bit of custom work:

    1. Create an instance variable for the player called prevx.

    2. Create an invisible sprite for the top of the box.

    3. Set the top sprite to solid so that the player can land on it.

    4. Every tick set boxtop.x + box.x

    5. Box -> is overlapping player -> set box x = self.x + player.x - player.prevx

    6. Every tick set player.prevx = player.x

cjbruce's avatar

cjbruce

Early Adopter

Member since 25 Apr, 2013

Twitter
cjbruce has 4 followers

Connect with cjbruce

Trophy Case

  • 11-Year Club
  • Forum Contributor Made 100 posts in the forums
  • x3
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

17/44
How to earn trophies