TheDoctor's Recent Forum Activity

  • Just to be clear, I think that a program development environment like Construct 2 can be intuitive and powerful. I really am enjoying programming with it because after working with other programming languages and environments, Construct 2 seems very familiar, for the most part the documentation is written very well, the website setup is nice and their event system is put together very nicely. I totally believe it can be made a lot easier for the new people and still made more robust for advanced programmers at the same time. Construct 2 doesn't have to be complicated for advanced users, it can be easy for them as well.

    Sure Construct 2 was programmed however it was programmed, but they don't sell what is behind the scenes to the customer, what sells is the frontend, which is the programming environment. -that's what users buy! You can always gut or change out the backend. For your target audience though, you should always develop your product with how they would like to interact with it. Recurring issues coming from the products users are sure signs that updates to the program need to be made. At least throw in some hints on what people usually get wrong when they use something.

    I also agree with your Function calls. I'm still trying to figure out what all I can do with their parameters in their function call. I have to say, I've never written so many global variables before, which makes me feel like I'm doing something wrong!

  • And building something on assumption about why programmers do what they do is a bit dangerous. There's already a lot of programming style out their and I'm not sure they would all agree on that one (:

    At it's core, a loop simply is a repeated set of commands in every language I've seen. How it is accomplished is up to the language and the programmer.

    One must always consider who their target audience is, yes? It's funny how they tote that Construct 2 is a "No programming required" way to make games...that tells me exactly who they are marketing it to. Getting a program to work is programming and if they want to make it easier to understand, to make it more suited to their target audience, then this is one thing they should address.

  • I don't think it would be a good idea, It is logic right now, it is like having the same set of event (not only actions) placed one after another:

    https://www.scirra.com/tutorials/56/how ... ait-action

    Consider this, the entire purpose of a loop is to execute a set of events over and over and over and over until it has done it enough times or stopped by some event. Logic, and the standard way of thinking in most programming languages, I believe, would dictate that loops, intuitively, are simply repeated actions.

    If I want to rotate a wheel 90 degrees clockwise, then I would simply rotate a wheel 90 degrees clockwise. You don't need a loop for that. If I want to rotate a wheel 90 times, one degree at a time clockwise, then I'd use a loop. I'd only put a command in the loop one time at one degree and then the loop would execute that 90 times. So, whatever I put in the loop code block, intuitively and logically, I want that to run for as many times as the loop runs. Whatever happens behind the scenes is all up to the creators of Construct. They can choose to program the Wait command any way they want, but I believe that the more intuitive you make something, the better the product is and the happier the users are!

    Right now, I believe most new users of Construct, especially those who program in other languages, would find it a headache to wonder why their instructions in a loop execute "all at once". Certainly they can look into the matter spending a few hours searching the manual, looking through many tutorials which aren't cross referenced and even wait for someone to answer "that same question again" on the forums, but that means the user interface isn't as intuitive as it could be. There is room for improvement.

    For me, I read the manual many times looking for the answer but couldn't spot it. I was looking through the tutorials, but I didn't think the problem was the Wait command, I thought I was structuring my loops the wrong way! I was doing all kinds of searches on LOOP STRUCTURE! I thought I had the conditions and sub events with my actions in the wrong place!

  • TheDoctor

    I understand your confusion now.

    In unity and java, python, etc, you can use some kind of wait or sleep to tell the thread to just stop execution for a (more or less) specific amount of time.

    But you don't really have threads in javascript (or rather you only have one), so the wait can't work the same.

    What the wait does is registering a set of actions to be called after a certain amount of time.

    But doing this registration happens in one go. The repeat 90 will register 90 set of action to be executed after a given time (hence the wait loopindex * 0.3)

    If the wait was really blocking the thread, all the game will stop receiving inputs (:

    Thanks! I get it now. Never programmed in one thread before. Now I understand why the loopindex works!

    Thinking about it though, wouldn't it be easier and simpler to have Construct just automatically multiply your delay by the loop index? I mean, generally when a programmer puts a delay inside of a loop the programmer is looking to have whatever is in that block of code repeated from top to bottom as many times as the loop executes. If the Wait command was outside of a loop it could default to running once. To me that would make the coding a lot clearer. I'm betting this is a headache with a lot of people new to Construct. -at least those that want to understand it well.

  • wait loopindex*delay

    Thank you so much! That little bit of code was what I was looking for. You threw me for a loop when you had all that other code in there.

  • Here's an effect you can use:

    http://www.scirra.com/arcade/addicting- ... 5-lighting

    just below it is the capx

  • his old moneybag

  • Tell us how it goes!

  • TheDoctor

    Thank you for all the feedback. Can you send me the specs on your tablet. Im going to try to make a emulator for it. I did not get that error my nexus 10 tablet.

    I didn't get any errors when running your app. Just saying I have seen that error before on my tablet.

  • Yann, thank you.

    I'll consider this thread closed now and I'm going to look more into Nested Loops to see if C2 really has that functionality...or start a new discussion on it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • my attempt...

    wait loopindex*delay

    Thank you, still, unfortunately, not what I was looking for, but very interesting to see how people tackle same problem.

  • Loops works fine inside events, but you have to understand how C2 execute code.

    When C2 reads it start from the top and go through each event and execute whatever it should.

    When it reaches a loop it will repeat the loop X amount of times, before moving on.

    The wait statement is a bit weird and think that might be what confuse you. The wait statement, doesn't store X amount of waits even if you repeat it 90 times. It will do it once when the wait timer is up.

    There are nothing wrong with using loops in conditions as long as you know how C2 handles them. Hope that makes it a bit clearer.

    Well, loops inside events aren't truly executed within an event if it is as you say. I will post another topic on NESTED LOOPS, which may be what I was getting at. Other programming languages handle loops entirely within their nested position in code, without the use of global variables...it seems C2 does not.

    In most programming languages I've worked with, an example like this:

    On Mouse.click

    {

    Repeat(90)

    {

    System.Wait(1)

    Sprite.Rotate(-1)

    }

    }

    here you can see that the loop, Repeat(90), is nested inside an event, Mouse.Click. Here, when the mouse is clicked, it starts the Repeat loop which will: tell the system to wait 1 increment of time, then rotate the sprite counterclockwise 1 degree, then tell the system to wait 1 increment of time, then rotate the sprite counterclockwise 1 degree, then tell the system to wait 1 increment of time, then rotate the sprite counterclockwise 1 degree, then tell the system to wait 1 increment of time, so on and so forth until that was done 90 times and THEN exit the loop. Inside the loop code, Repeat, it executes whatever commands it finds there from top to bottom until it is done and then it exits the loop.

    C2 seems to run a nested loop only once and then exits. Of course, if the loop isn't nested in C2, it seems to work fine. At least, that is how I see it so far.

TheDoctor's avatar

TheDoctor

Member since 21 Feb, 2014

None one is following TheDoctor yet!

Trophy Case

  • 10-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

12/44
How to earn trophies