gautam's Recent Forum Activity

  • Hi,

    I want to generate random objects at a particular interval. This is what I have done:

    1. I have created one object.

    2. Added animations to that, which are the other objects that I want to appear randomly.

    3. Created an array.

    4. On Start of Layout, <array name> push back <animation name> on X axis. I did this for all the animations.

    5. System > Every 0.7 seconds > System > Create Object <object name> on Layer 1 at <co-ordinates>

    6. <Object name> > Set animation to arrayName.At(floor(random(arrayName.Width))) (play from beginning)

    But my problem is, though all the animations appear randomly, almost 90% of the time, just the first animation keeps spawning.

    How can I make it that everything is random and one object is not overly dominated?

    Thanks.

  • You, good sir, are a genius.

    Was creating a separate capx to isolate the problem, when I thought of changing the position of the command to another place, and now its working!

  • Hi again people!

    I am having a weird bug in the project I am developing. I am posting this after pulling my hair out for the last three hours on this issue. So, please help if you think you know how to correct it... thank you! Here is the issue I am facing:

    In the game, I want "Monster" to spawn randomly at a location and walk towards the player after the player scores 100 points. After striking out tasks one by one, here is what I found:

    When I do this:

    System: At Every Tick :: Monster : Set Angle Toward(Player.X,Player.Y)

    The monster spawns at the start of the game and walks towards the player. So, its behaving as I had wanted to with that above command.

    But, when I use the following conditions:

    System : Score >100

    System : Score <500

    System : Every 10 seconds

    System : timescale "not equal to" 0

    And use the following actions:

    System : Create Object Monster on layer 1 at (random(130,1105),random(30))

    Monster: Set Angle Toward (Player.X,Player.Y)

    The Monster spawns once the score reaches 100 BUT does not walk towards the player.

    Note: The score is a Global Variable.

    Please help! Any help would be greatly appreciated. This is the only major roadblock that is remaining for me in this project.

  • Hey! I found a workaround for it!! Finally!!!

    Since when any enemy dies, they use a common Smoke sprite, I just made the powerup spawn randomly from the smoke at random seconds.

  • Hi.

    Yeah, that is what I am aiming for. When the monster dies, it spawns a new object, which is the random powerup. But, I don't want a powerup to spawn on every death. It has to be random. I don't have the monsters in array. Every monster is a unique one.

    So, I have:

    Monster A, Monster B, Monster C, Monster D.

    All the monsters spawn infinitely. Is there a way I can do a collective "random powerup spawn at any death", even though the monsters are not in an array?

    The problem I am facing is since the monsters spawning is infinite, I am not able to give percentage for the powerup drops. :(

  • Hi,

    So here is the scenario:

    I have four different types of enemies in my game. The enemies spawning are infinite. When I kill a random enemy, I want the enemy to spawn a random powerup.

    I am able to spawn random powerups, but cannot figure out how to make it fall from a random enemy when the enemies keep spawning infinitely.

    I don't think the Compare Two Values would work because the count is infinite, so cant put a First Value and Second Value... unless I am mistaken.

    Please Help.

    Thanks.

  • Hi again!

    ***Update***

    Solved the color matching and destroying issue :)

    Just the overlapping thing is still remaining :(

  • Try Construct 3

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

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

    I am facing couple of issues:

    1. I want objects to spawn on a random Y axis between two values, but in case there is already an object present at the point, the new object should not spawn. Tried "if overlapping" destroy "object A" and stuff, but could not do it successfully.

    2. I have a color matching scenario where, if yellow bullet matches a yellow character, both get destroyed... else only the yellow bullet gets destroyed. But, if everyone color bullet destroys Red as well as their respective color.

    Help please!!

  • Hi, I still was not able to get it right... can anyone give me a sample on how to use it? I dont think I am doing it the right way too.

    I have put instance variables (oldx and oldy) to player as well as the enemy. I have set values:

    PlayerBox: On Created -> Set oldx to PlayerBox.X

                          -> Set oldy to PlayerBox.Y

    And the same for enemy too.

    After this I dont know how to compare distances between the two objects. :( The distance says I have to input 4 values, whereas I just need to see if the distance between the two on X axis.

    Please help :)

    Thanks!

  • Hi, I have created an enemy.. got the enemy patrolling using edge markers, but I am unable to figure out how to get the enemy to fire if the player comes within a certain range of the enemy (line of sight kinda)

    The enemy shoots only on the X-axis while facing the Player.

    So, I wanted to know how to make the enemy fire at the player when the player reaches within certain pixels(?) of the enemy.

    Thanks!

  • Thanks! Got it! :)

  • Hello again. I have 2 queries. One of them is really simple, but I am unable to figure it out... the other one is simple too I guess.

    #1: I have set the Layout size to 1280x1024 and have placed Objects. I can see a square inside the layout that shows what will be shown on screen. How can I increase the size of that? I want to increase it to display complete 1280x1024 when I press Play.

    #2: I have four types missiles, four types planes and four types of bullets. If any missile hits any plane, both the missile and the plane gets destroyed. Currently, I have made different events for these.

    Ex:

    Missile01 -> On Collision with Plane01 -> Missile01 Destroy, Plane01 destroy.

    Missile01 -> On Collision with Plane02 -> Missile01 Destroy, Plane02 destroy.

    and so on...

    Is there a way that I can use: if 'any missile' hits 'any planes' both missiles and planes get destroyed? All the missiles and planes are unique objects and not different instances of the same object.

    I am using same long process even for bullets, but with a variation:

    Bullet01-> On Collision with Missile01 -> Bullet01 Destroy, Missile01 destroy.

    Bullet01-> On Collision with Missile02 ->Bullet01 Destroy, Missile02 DOES NOT destroy.

    and so on...

    Is there a shorter way where I can use: If bullet01 collides with missile01, both gets destoryed, else if it hits other missiles, only the bullet gets destroyed, but missiles continue on their path?

    Thanks!

gautam's avatar

gautam

Member since 11 Oct, 2012

None one is following gautam yet!

Connect with gautam

Trophy Case

  • 12-Year Club
  • Email Verified

Progress

13/44
How to earn trophies