dop2000's Forum Posts

  • I like using Scale Outer mode. See this post:

    construct.net/en/forum/construct-2/how-do-i-18/full-screen-138474

  • You are aware that this post is 5 years old?

    Answering your question - you can't create object on another layout. But you can "schedule" it using global variables. So when that another layout starts, check the global variable and create objects if needed.

    For example, in the main menu player chooses game difficulty. If difficulty=Hard, then you want to create some zombies when the level starts. So you can add a global variable ZombiesToCreate=0. When player selected hard difficulty, set ZombiesToCreate=10.

    On start of the Level1 layout do

    Repeat ZombiesToCreate times : System create Zombie...

  • There is a useful new action "Wait for previous action to complete" for asynchronous operations like LocalStorage or AJAX. Change your code like this:

  • I have a weird issue in my game - on one of the layouts, when I press Back button on mobile phone, the "Browser On Mobile Back button pressed" event is triggered after a long delay, between 1-10 seconds.

    This happens only on one specific layout where I display leaderboards. The code is very simple - "On Mobile Back pressed go to MainMenu layout". I put this event at the very top of the event sheet, before any "includes", and there is nothing else in the event sheet that may cause this problem. The layout is otherwise responsive and on-screen Exit button works fine.

    What's the worst part, if I press Back several times on this layout, these presses are saved in some sort of buffer. So when I tap Exit and go to another layout, the buffered Back button events are triggered there!

  • NetOne You are probably previewing the wrong layout :)

    Run "Layout 1"

  • Like AlanR explained, loops in Construct are actually performed in one tick. If there is a Wait inside the loop, it doesn't pause loop execution, it creates a delayed thread. So a loop like this becomes infinite and will freeze the browser:

    While
    stop=0
    	Wait 0
    	Set stop=1
    
  • You need "Wait loopindex*0.016" if you want the loop to iterate 1 tick at a time. But this won't work with While loop, you should use Repeat or For:

    Repeat 100 times
    	Wait loopindex*0.016
    	ProgressText append text "."
    	// do some cpu-intensive stuff here, 1/100 portion of it.
    	// For example, if you need to fill a million array records, fill 10000 here
    
  • I don't understand you. If you want to spawn only 1 bullet for every 1 touch, then you should use "On any touch start" or "On touched object" event only.

    Do not use "Is touching" event! If you have "Is touching" or "Is in touch" event, delete it.

  • Instance variables is exactly what you need here. For example, you can create instance variable platformUID on the Lever sprite, set correct values for each Lever. When Lever is touched, pick Platform with UID=Level.platformUID and activate it.

  • Use "On touch start" event, not "Is in touch".

  • Ashley I always wanted to ask - why rgb() expression inverts the result? For example, rgb(0,10,255)=16714240 , which is #FF0A00 in hex. It should be #000AFF, why R and B values are swapped?

  • Yes, search this forum for "virtual joystick" or "virtual gamepad" or "thumbstick", there are lots of examples. Here is one I made for another post:

    dropbox.com/s/7p6fgru06zrzvpj/Thumbstick8Direction2.capx

  • Then you shouldn't have posted this in C3 forum :)

    Here is a version that doesn't use bullet stepping.

    dropbox.com/s/7tfobtbs6vqwoud/BulletTrail3.c3p

    It's not so nice looking, may require additional tweaks.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's not that bad, on my laptop the trail adds about 5-10% to cpu utilization, gpu is at 0%. On a very old phone it adds 15-25% to cpu.

    .

    You can decrease fade out time, this will make the trail shorter, reduce the number of trail sprites and improve performance. You can also spawn trail sprite not on every step, for example skipping 2 in 3 steps.

    Another solution is to use just one object for each trail line, changing its width on every tick instead of fading, but this may be a bit more complicated.