dop2000's Forum Posts

  • You do not have permission to view this post

  • In C3 you can do this with Drawing Canvas. Paste your image to multiple small Drawing Canvas objects, after that you can remove the image and re-shuffle the pieces.

  • No, when "On touch end" is triggered, the screen is still considered in touch. So you can still check for "Is touching object".

  • Most of your code is what's called "state machine". You have a bunch of variables and checking their states on every tick.

    I prefer keeping everything in triggers and functions, this code is shorter, cleared and much better for performance.

    Here is an example of state machine code:

    On collision with Enemy : Subtract 10 to health
    
    On collision with HealthPotion : Add 10 to health
    
    If health>100 : set health to 100
    
    If health<=0 : Set isDead=true
    
    If isDead=true : Player start animation "dead"
    
    and so on....
    

    There are too many events, most of them running on every tick.

    Here is how I would do it:

    You can call the function from other events, where the player gets hurt.

  • I have no idea why you need all this and why you have "ray-casting" in the subject. But the easiest way to check if a point is inside the object's hit box is to use "System Pick by overlapping point" event.

    So on touch end you can pick Button by overlapping (Touch.x, Touch.y) and that's it. You can also check if Button is overlapping (OldTouchX, OldTouchY).

    I believe "Is touching object" condition also uses object's collision polygon.

  • No, in the first event don't append to the text! Set charTyped value to lowercase(Keyboard.....)

    Add another sub-event below the "Shift is down" and there append charTyped to the text.

  • yes, CharTyped is a text variable. You can append it to your text.

    If you do it correctly as on my screenshot, you will be able to type special characters with Shift key.

    When Shift is down, it will search for CharTyped in charsNormal string, and then replace it with the character at the same position from charsShift string. "a" will become "A", "2" will become "@" and so on.

  • Never use "Wait" and "Every X seconds" with long duration when programming game mechanics. You have no control over these events. "Every 20 seconds" may fire when you just started the level, as it's based on the project time, not on layout time. "Wait 5 seconds" is also bad, because in these 5 seconds something may change (the boss may already be dead for example), and you can't cancel the scheduled actions.

    Use Timer behavior instead. You can pause or cancel the timer, check the remaining time, run different timers for different object instances etc.

    .

    Another issue with your code is that most of your events are running on every tick. This is bad for performance and makes the code difficult to manage. But most importantly many of these events are not supposed to be run on every tick, for example events 9-12 will create lots of duplicate text objects.

    Instead of a "state machine" with dozens of global variables, use triggered events and functions.

  • Here is how I did it in one of the projects:

  • For the record, here are all the features of a popular Pin+ addon, some of them are quite useful and it will be nice to see them implemented in the official behavior:

  • This an ok way of doing it or a bit of a bodge job?

    No, it's not an ok way of doing it.. Add "System trigger once" condition to "Life<=0".

  • You can find my email in this post

  • It would indeed work a lot better if people shift most of their votes to small/quick/easy things

    Many ideas with a large number of votes were posted a long time ago and may not be relevant any more. And most of the people who voted for them will never return there to change their votes.

    So while this voting system was working fine at the beginning, it's definitely not working now. Maybe you should reset all votes. Let people to decide and choose which of 700+ ideas they want to see implemented.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can use "Save image" action, and when it's finished, DrawingCanvas.SavedImageURL expression. Save it to Local Storage the same way you did with canvas snapshot. (via AJAX and BinaryData).

    To load the back into the canvas, I believe you need to load into a temporary sprite and paste this sprite on the canvas.

  • Yeah, Tween behavior really lacks looping and reversing options. I posted this idea a long time ago:

    construct3.ideas.aha.io/ideas/C3-I-647

    You can simply run the second tween after a delay: Tween "increase_size", wait 0.2s, Stop Tween "increase_size", Tween "decrease_size"

    Or I often use this simple effect:

    On Clicked Button 
    	Button set scale to 1.05
    	Wait 0.1s
    	Button set scale to 1