dop2000's Forum Posts

  • It's the angle between two angles, useful expression when dealing with angles in Construct, because they may have negative values.

    Say, anglediff(20,50)=30, anglediff(179,-179)=2

  • There is probably an easier way, but this code seems to work well:

    dropbox.com/s/b7q3vofq8ujqxze/ReflectionAngle.c3p

  • I guess it's similar to sharing screenshots, see these two templates:

    Screen recording

    Sharing screenshots

    Record a video. Then feed it to AJAX:

    AJAX Set Response binary to BinaryData
    AJAX Request GameRecorder.RecordingURL
    

    Then add BinaryData as a file to Share plugin and share it.

  • You can use the same principle with Physics. On collision set Physics Velocity: X component=(Self.Physics.VelocityX*1.1), Y component=(Self.Physics.VelocityY*1.1)

    Don't forget to set Bullet=Yes in Physics properties for the ball, otherwise it may glitch when moving too fast.

  • Asynchronous actions are marked with a little "clock" icon in the event sheet. When these actions are finished, they usually trigger "On completed" event, or you can use "Wait for previous action to complete" as mOOnpunk suggested.

    All other actions are completed immediately and you don't need to use Wait.

  • All operations with dictionary keys are completed immediately, you don't have to wait.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • AFAIK, Load from JSON is not an asynchronous operation. It is completed in the same tick. Even if JSON string is very big, there will be a lag, but the next action will not be performed until data is loaded into the dictionary. So you don't need any wait at all.

  • Awesome, thank you!

  • Ashley, Nepeo - first of all, thank you for this great feature!

    As I understand, the main idea of scripting is to extend events, not replace them. Unfortunately, there is currently only one template (Ghost Shooter), and it doesn't provide much information on using scripting in combination with event sheets.

    So could you please add more templates/tutorials for people like me not very experienced with JavaScript, demonstrating how to use scripts integrated with events. Particularly:

    • When object instances are picked by event, how to pick same instances in the script. For example, I have an event "Player has LOS to Enemy", inside it a JS function "MarkEnemies()" is called, will it automatically pick the same enemy instances as the parent event?
    • Different ways to pass information from the script back to events - set global/local variables, call C3 functions etc.
    • How to use object's triggers, conditions and run actions from the script? For example, if I need to change Bullet angle, I should call something like Player.Bullet.SetAngleOfMotion(n) - what is the correct syntax and where can I find this action/method name?
  • Are you using Bullet behavior for the ball? The easiest solution would be to set Bounce off solids=yes and add Solid behavior to the paddle. Make sure the collision polygon on the ball resembles a circle.

    If you want to bounce the ball with events, see these posts:

    construct.net/en/forum/construct-3/how-do-i-8/wrong-thv-game-145070

    construct.net/en/forum/construct-2/how-do-i-18/trying-to-get-breakout-paddle-136118

  • The easiest solution is to save the text in a variable or dictionary before changing it to uppercase. Then, if user wants to revert back, simply restore the text from that variable. Like an Undo system.

  • What behavior are you using to move the ball? If it's Bullet, you can do something like

    Ball on collision with Paddle -> Ball Bullet set speed to (Self.Bullet.speed+20)

  • I assume you mean Chrome browser? Do you know which version was installed before you updated it?

    LukeW It's unlikely Scirra will look into this without a proper bug report, and for it we need to collect some information - phone model numbers, Chrome version numbers, sample project, logs etc..

  • Menu -> Project -> Remote preview.

    But it doesn't work in free version.

  • Here is how you record a 3-seconds video and prompt to save it to disk.