imhotep22's Forum Posts

  • How do you call the sound in the event system, on layout load or some where else?

  • Are you using sprites for your objects? If so they look really bad when you stretch them, try using a 9-patch or tiled background for images you want to stretch out.

  • Sure give me the capx file, ill do it tonight.

  • Why are you guys making things complicated, luckyrawatlucky you can use the same event system you wrote on start, just ad an trigger every sec condition which will prevent the sprite from rotating twice on a double click or fast clicking (every 0.5 sec or 1 sec will be sufficient).

  • Use an array and safe it as Json.

  • Well you can add your sound play effect in a function, and call the function from the collision detection event to play the sound, but in the function it self add once every sec condition to like 1 sec, this means the sound can play only once every 1 sec.

    Edit: If you want to play it twice, call the sound action twice, but you will have to add wait condition at least 0.1 seconds so they will not trigger at the same time ( if they do, you wont be able to tell the difference)

  • hm that is weird, once I had serious lag because my collision detection was bad, the game was checking between 15k-25k collisions per second if remember correctly but that thing showed up in the debugger and CPU usage was between 80-100% all the time.

    Maybe you have the time scale lowered then 1, so it seems like the game is lagging but its Actually not. You should check that just incase.

    I cannot think anything else that can be the problem, another think you can do is try Disabling event by event, and check performance difference.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can select the object with your mouse, and a blue square will appear around it, hover on the edges of the square and you will see a white point, click there and drag it to resize, also on the left side of your screen you can see input fields for the selected object, there's a filed called size you can use it to change the select object size in pixel's ( example 20,20).

    As for the curved lines, construct uses images for the graphics rendering, so if you want a curve line you will have to draw it first on paint or photo stop then you will have to import the image into construct.

    If you are new to construct I suggest you start by reading the manual first

    https://www.scirra.com/manual/1/construct-2

  • Here is an simple example I made, the event is bit different then my explanation above, but it does the trick every instance is created with a different random color.

    https://www.dropbox.com/s/etc3o79zi004t ... .capx?dl=0

  • You have to do some debugging, start the game in debug mode on the right side click profile, and see what events take the most CPU time, then you will know what is making the lag.

  • I made you an example have a look.

    https://www.dropbox.com/s/fkaeepyh484k810/move_animation.capx?dl=0

  • Okay I see what are you trying to do, when you change the color it changes for every single instance, but you want it change for 1 only. This can be little tricky to implement. Add a global variable called color_picker, add the same variable as a instance variable to the square object. When you create your object increment both the local and the global variable by 1. Add the change color function, and call it with a parameter which is equal to the instance variable. This means that the function will trigger only once on the object with the current id, the next will spawn with different id because we are increment it by 1 each time you create the object and it wont be effect by the function.

  • Are you sure the variable are the ones causing the lag? I suggest running in debug move and in the event tab see what takes the most memory from the system.

  • Use a 9-patch for the rectangle, then you can resize it how you want without huge loss on quality.

  • Implementing a system clock is the way to go, wall clock can be easy abused because it uses the user time, which he can easy change to get some kind of advantage.

    I had a simple clock on my game implement with 3 variable, 1 for seconds, 1 for minutes and 1 for hours, every 1 second when the game should be running I increment the second variable by 1, when it gets to 60 I reset it to 0, and add 1 to minutes, when minutes get to 60 I reset it to 0 and add 1 to hours. You can make a simple clock like that, and If you want to continue where it stoped after the game is closed, you can keep the variable values in a json file and load that on game start.