lionz's Forum Posts

  • Your logic should work with a tweak since Squad is likely a local or global variable, so your logic on the other ships should also be set squad to Squad, not set squad to sprite.squad. Another way of doing it since you are doing a function is determine the squad number before you call the function then send it through function as a parameter. Then every ship created in the function can be assigned param(0).

    To actually calculate it there are a bunch of ways to do it. Easiest way is probably on enemy destroyed, take its squad number and then determine if any other enemies with that squad number exist. If no other enemies exist with that squad number then grant the bonus. But that's based on the gameplay and if enemies can die in other ways that do not grant the bonus or if they die off screen.

  • Kyatric website bug or was the French manual never available?

  • How have you done the movement logic so far? You could use instance variables to define a certain direction or type of movement, and you pick the enemy at the time of creation to assign the variables. You could say on created, give variables choose(0,1) either 0 or 1, then have logic if variable =0, set angle 0 if variable=1, set angle 180, this in its basic form would allow an enemy to move left or right on creation.

    By at the same time I assume you mean the speed of movement, again you can define this in a range on creation, the issue you have is probably nothing is defined and all enemies are created with same speed, you can say on created enemy set movement speed to random(300,500) for example to give it a speed within a random range.

    As for stopping when it reaches the player, this should only really apply to the enemy that reaches the player if the logic is done right. For example if you had enemy overlapping player, disable movement then this would only pick the enemy that is overlapping the player.

    Depending on how complex the game is, what I like to do, and I guess others, is to use instance variables as states for "walk" "attack" "stop" etc. You can define this with functions where you send the enemy's UID through the function to ensure it is that specific enemy to do the actions and then you run the relevant logic for "walk" "attack" "stop" etc

  • Yes add another condition to variable=1, 'trigger once', it's under system conditions.

  • How do you trigger the create object action? There is a condition 'trigger once while true' also under system, you can use this.

  • Well whatever you want to alternate between you can set a variable to choose(x,y,z...) command to pick from a number of options. Then you say if variable=x, do this, if variable=y do something else.

  • Sorry, not sure I fully understand that question. Do you mean alternate between two objects being created? Do you mean do not overlap in their position when created?

  • The create object action has x,y co-ords you can set a random x or y in the same way. Also I should note random also picks decimals in range so if you want specific you can use round(random(x,y)) to make it a whole number.

  • Do you mean the creation time should be random? Replace the 3 with random(x,y) to create a random time in a range.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You could use tokenat to get a random 1-4 position of a string "*,+,-,/" but I'm not sure you can convert that found string back into an operator. Sounds like an unncessary workaround.

  • Rex's MoveTo plugin is good for this. You just specify an x,y or object to move to and it will move in a line to it. construct.net/en/forum/extending-construct-2/addons-29/behavior-moveto-40701

    Aside from this, you could have the moving sprite as a bullet and specify its angle of motion towards touch area. Also you could use Pathfinding to find a path to the specified location (touch.x,touch.y)

  • Hiya, you'll need to post some events or a playable C3 project to get some help with this otherwise it is just guesswork. The problem could be with your logic and picked objects or collision, multiple things really.

  • Do you pick up the key by walking over it? If so, then on player overlap key set door open; door open could be a boolean variable on the door; door.open=true. If you are picking up with mouse click or touch, then on key touched/clicked, set door.open=true. Then you have an event, player can only advance or door will only work if door.open=true.

  • I could calculate A and C as a random number, then I would have B as a variable choose(0,1,2,3) then have 4 events if B=0 A+B, if B=1 A-B, if B=2 A*B, if B=3 A/B

  • I'm not sure how text variables relate to that code as there is no text object but yes you can set a text variable to a random range in the same way.