szabesz's Forum Posts

  • Wow, thank you for all the replies!

    First, I need to consider all the info and questions than I'll be back soon... :)

  • Hello there,

    I have put together a simple traffic lights "simulator" in an effort to implement a simple state machine and to test how the Timer behavior works.

    I wonder if anyone can help me by suggesting improvements on how to "instruct" the lights to change state with a state machine approach, and also on how to use the Timer behavior without using "too much" CPU resources.

    #1 States of the lights

    For example, in JavaScript I could implement the publish/subscribe pattern so that each light can be notified when to change state. As far as I know there is no such thing built into C3 and while turning to vanilla JavaScript to implement it is one option, to simplify things, I just used the Every tick event to poll state changes. However, I wonder if there is a better solution maybe? Also, when using Every tick with lots of sprite instances, isn't Every tick going it consume a lot of CPU resources perhaps? Three sprites are not a big deal but what about a hundred?

    #2 Using Timers

    First I tried to pick ONLY ONE light instance for the Start Timer and I tried to pick a different light instance under its On timer condition, but there was no way of picking a different one, not even by UID. In other words, the scope of the "On timer" condition was the one and only instance of the initiating Start timer. To solve this, I simply start a Timer for each light, which works but still.... why running three Timers when only one would do the trick (at least in theory)?

    So my questions are: is there anything I'm missing? How could I improve my traffic lights simulator so that in real life projects I can use those improved techniques instead?

    You can download the C3 project form here:

    szabesz.hu/_dl/c3/SM-TrafficLights.c3p

    Side note: my traffic lights work in this sequence: drivingtesttips.biz/traffic-lights-sequence.html

    Thanks in advance,

    Szabesz

  • Domino99 Hello,

    First things first :) I think you need a board adapted to playing on the screen.

    This is what I made for you: szabesz.hu/_dl/c3/singlepoly-design-v1.zip

    Saved in PNG, SVG and PDF so that you can pick what suits you best.

    Note that I recommend not using millions and billions as that just takes up screen space.

    If you adapt your game to my layout then I am happy to move forward to help you in the other UX issues the prototype has.

    Preview:

  • Aekiro Just a follow up: actually the issue was this:

    Check the top sprite collision box, maybe it's not.

    I should have thought of this, thank you for pointing me in the right direction!

    Incidentally, I have not yet worked on C3 projects which did not use non-rectangular sprites, so even though I was aware of the importance of the polygonal collision box, I forgot about it.

  • Thanks for the reply!

    Check the top sprite collision box, maybe it's not.

    If you still can't achieve what you want, please reach me on discord (username = Aekiro#1066) with an anexmaple project. it's much faster to communicate there.

    I will proceed accordingly.

  • Aekiro Any chance you can reply to my question above? Thanks in advance!

  • because I think for now it can be quite messy and overwhelming

    Sure, I had to do some extra brain work just to see what is going on. Some extra brain work never hurts, but still... :)

    Anyway, if it won't be too late by then, I can spend some time on it this weekend, drawing some mockups for you.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Graphical preview

    Nice graphics and I like the sound fx too.

  • Hello, please go to: github.com/Scirra/Construct-3-bugs

  • Suggestion is up: construct3-21h2.ideas.aha.io/ideas/C321H2-I-173

    Cool! Maybe you want to add a reference to this thread as well?

    BTW, I cannot vote for this I have already used up my votes for the current "season" but since Diego said it is easy to implement let's hope for the best.

  • Shortcuts for changing between animation would also be quite easy to implement, but I am not sure what should they be? Any suggestions?

    CTRL + ALT + arrow keys perhaps?

    While we are at keyboard shortcuts, I am missing these:

    • close project
    • start page
    • addons manager
    • export manager
    • settings

    I used Keyboard Maestro to automate it, but native shortcuts would be great. Am I missing something maybe?

  • ...they tend to be unreliable, especially when going through exact mouse movements and not keyboard shortcuts.

    Sure, but with some extra effort a lot of time can be saved when there are no other means to speed things up. Good luck!

  • ...is there a way to crop all the animations in a sprite?

    I need to add, that I was referring to this question, and not the previous one.

    If you click the little arrow pointing down, by the "Crop Transparent Edges" in the Sprite Editor toolbar, there is a selection of "Apply to Animation"

    I missed to add this, but brainwavecreations dit not forget it ;)

  • As far as I know, the answer to both questions are "no".

    I cannot find any shortcuts for selecting animations here: construct.net/en/make-games/manuals/construct-3/interface/keyboard-shortcuts

    I'm on Mac, and I often use the commercial Keyboard Maestro application to simulate missing shortcuts and more. Probably other systems have similar tools too.

    Since the ANIMATIONS panel's position relative to Construct's window is fixed, it is possible to automate mouse movements and clicking sequences so that keyboard shortcuts can be assigned to them, I mean in Keyboard Maestro and similar tools. The same goes for the crop tool but all this 3rd party automation is only worth the effort if you need to do a lot of manual clicking, I guess.

  • Feel free to use it, modify it and to tell me how I can improve!

    Hi, thanks for sharing! Regarding possible improvements, you wrote that it is a prototype, so my question is that in what areas are you looking for improvements?