TheColdVolcano's Forum Posts

  • Hello,

    I have a fake 3D game vertically scrolling. There are two ways in which a player can move (run and fly - powerup). All my obstacles have a solid behavior. When the player is running it does not pass through any of it. However, when the player is flying I disable all the collisions and put the player on the top of the layer so that it gives a feeling that it is flying. There is a flying timer which when runs out the player falls (enable all the collisions). What is happening is if the player falls on any of the obstacles, it gets stuck due to the solid behavior. How can I handle this?

  • howtoconstructdemos.com/spawn-objects-randomly-without-overlapping-2-capx

    This helps. However it does happen sometimes that the instances are created in one particular area and other area remains empty. Is there a way this can be tackled?

  • What is the best way to randomly create non-overlapping objects?

    When I write a create object action:

    Create object X on layer 0 at (int(random(100, 1720)), int(random(100, 880)))

    This creates object randomly on the layout. Let's say I have to create 10 instances of the same object randomly, the above event creates multiple instances overlapping with each other. What is the best way to tackle this?

    I tried to check with "is overlapping" condition after creating the instance, destroying if overlapping and then again randomly creating it. But this takes time to settle all 10 instances.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello,

    Is there a way we can loop through the objects in the family (and subsequently create it) when none of the objects in the family are created yet?

    Tagged:

  • Following example has 2 different way to create random object: dropbox.com/s/1ng5la2xx3yjyvr/summon_random.capx

    Thank you for sharing this. However, I am unable to open it. Can you please take a snap and share?

  • It could be better to make one object with different animations instead of 10 objects. You can use the Is playing condition if you want each of them to have different events and actions. If you do this you can set the animation to str(round(random(1,10))).

    For Each Placeholder -> Spawn another object (fruit)

    Also, do you want to use pin to just set position or is there another reason?

    What happens when I have multiple instances of the same fruit? How can I uniquely identify them to trigger events or actions?

    I am using pin because I am trying out a vertical scrolling game. If the fruits are pinned to the placeholder, they will move along with it.

  • Hello,

    I have a family consisting of 10 different fruits. None of these fruits are yet created on the layout. Is there a way in which I can pick a random fruit from that family and create it on the layout?

    I cannot use the pick system condition as none of the members of the family are created yet.

    To be precise what I am trying to achieve is:

    I have 15 placeholders on the layout (1 object 15 instances). There is 1 fruit family (consisting of 10 different fruits). I want to randomly pick any one of the fruit from the family and pin it randomly on any of the 15 placeholder (upon doing this, the placeholder that already has a fruit pinned should not be picked again).

    Any suggestions or a way to achieve this?

    Tagged:

  • Hello,

    I am trying to achieve something similar to this:

    https://draw-pie-chart.netlify.app/

    I just want to fill this circle in a similar fashion without any parameters in x number if seconds. How can I achieve this?

    I could not find any behaviour.

    Edit 1: This is the exact effect I am looking at:

    https://javascript.plainenglish.io/how-to-animate-svg-circle-with-javascript-8e8c720ee3a2

    Check for Full SVG circle animation

    Tagged:

  • does it work if you take physics out of the equation?

    Physics is required in my case. It is working even with physics. It is switching from jumping to climbing and vice-versa, however, sometimes that switch is not smooth as the player tries to cling on the stairs when I press the up key. Please note jumping and climbing both happens with up arrow.

  • Hello, I am trying to switch between climbing and jumping. The jump and climb actions are defined in their respective group. What I have done is when the player is overlapping the stairs, I enable the climbing group else I enable jumping.

    However, what is happening with this is that when the player reaches the tip of the stairs, it goes into confused state where it is overlapping but also has to switch to jumping and that transition is somewhat not smooth. Since overlap is checked every tick, I was checking if there is a way to check for collisions and invert to make the same thing happen. How can I achieve this and make it smooth?

  • Is there a way in which I can save the state (especially local and global variable, object properties) while moving from one layout to another?

    I have a master layout to perform a few activities. Based on the activities, there are different games launched (as a new layout) from this master layout. After playing those games, I return to the master layout. This is where I want to ensure that the activities I performed before is retained.

  • I have imported mp3 audio files into my project. While launching the project via Construct, it works fine. However, when I host the exported package, it runs into the following error:

    [Construct 3] Failed to load audio 'media/myaudio.webm': DOMException: Unable to decode audio data.

    Any idea what could be causing this?

    Laptop / Chrome. haven't tested it on other devices.

    Tagged:

  • You do not have permission to view this post

  • I have a function defined under script tag of index.html

    	function showAlert(){​
    	
    	alert("Hello");
    

    How can I call this function on certain events?

  • You can create a special object (for example an invisible sprite), and add NoSave behavior to it. Use this object to run the timer and to store different values in its instance variables, which you don't want to be affected by the saving/loading events.

    I have a global variable named TimeRemaining. I set the timer every second as below

    When I use a System action called "Save Game", it saves the value of the global variable. This happens when I reach a checkpoint. Now, for example, The game continues thereafter for 10 more seconds before player hits the obstacle. In this case I have to reset the game back to the checkpoint, so I use the system action "Load Game" and mention the slot to load. This leads to resetting all the variables including the "Time Remaining" global variable. I want to avoid resetting this variable.

    With your approach it will just save the state of the object but not the variable. Or am I doing something wrong?