mindfaQ's Recent Forum Activity

  • Well I can explain the formula for you:

    cos(angle) gives the x-portion of the bullet movement back to you (going right on screen gives a positive value, going left a negative value)

    sin(angle) gives the y-portion of the bullet movement back to you (going up = negative, going down = positive)

    dt*bullet.speed just is the distance the bullet would travel without interference

    so all it does is setting the movement on the overlapped axis back to where it was before the bullet movement of the current tick while retaining the bullet movement of the other axis.

    Result: bullet speed is not retained, if you want that you probably need to add the movement you've taken away to the other axis (need a condition construction to not get the signs (+-) wrong)

    Result 2: once both overlap, you get no movement at all (in your version) or weird movement (when keeping bullet speed constant); can't really prevent that no matter how the dimensions of the boxes are; only thing you could do is check if movement is frozen and then do a turnaround or slight change in coordinates to allow a fresh approach to the wall (this is probably prefered for you)

    so I can imagine that something like this could work:

    Detector X overlapping wall

    --> Enemy set X to self.x-cos(self.Bullet.AngleOfMotion)*self.Bullet.Speed*dt

    --> enemy add "1" to enemy.variable

    Detector Y overlapping wall

    --> Enemy set Y to self.Y-sin(self.Bullet.AngleOfMotion)*self.Bullet.Speed*dt

    --> enemy add "1" to enemy.variable    

    for each enemy

    -system compare

    --> if enemy.variable greater of equal 2: enemy set y to self.y -sin(self.bullet.angleofmotion)*self.bullet.speed*dt

    • no condition

    --> set enemy.variable = 0

    instead of modifying the angle you can also add -sin(self.Bullet.AngleOfMotion) to y to make the enemy take a new approach

  • What do you mean by preventing the display of the correct sequence? That 5 4 3 2 1 are spawned in random order?

  • Depends on how you create them. If the program you are using has proper alpha channel support (like GIMP/PS), create a new layer when starting out and paint on that. Hide the background layer. Save it to png 24bit

  • conditions:

    invisible sprite - overlaps waypoint

    invisible sprite variable "nextwaypoint" < waypoint.iid

    action:

    set invisible sprite variable "nextwaypoint" to waypoint.iid+1

    event:

    for each invisible sprite

    subevent

    pick by comparison; waypoint where waypoint.iid = "nextwaypoint"

    action:

    set invisible sprite angle towards waypoint.x waypoint.y

    that should do it

    for smoother transition use rotate towards waypoint.x waypoint.y instead with a small angle

    the sprite will go from the first waypoint it touches to the one that was created after the touched one, so keep that in mind when building your path

  • Try this: s000.tinyupload.com/index.php

    Maybe breaks at faster bullet speeds and positioning of more crowded angle compositions can be tricky, but other than that works. Ofc you'd need to do that stuff for each enemy.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • here:

    s000.tinyupload.com/index.php

    edit:

    sry, the first version has inconsistencies with the angle.

    This fixes it:

    s000.tinyupload.com/index.php

  • Probably pin the objects (pin behavior) that make up the menu to a sprite (menu background for example) and only move this one sprite in and out.

    Dunno what you mean with the button. You can use an instance or global variable to check whether it should spin or not.

  • You could try this, if you want to have more control:

    <img src="http://666kb.com/i/cihmto2saxov0tc2b.png" border="0" />

    More random means more randomly distributed over the spread. 0 means equal distribution over the angles, 1 means completely random over the spread angle.

    Of course you can also load instance variables instead of using local variables for spread, randomness and projectiles (not for a though).

  • Hello guys, I'm mindfaQ. Currently I am trying to create a top down TD, but still have much to do all over the place. Still regularly running into things that aren't working as I want them to ^^.

  • Why not randomly create the enemy together with each platform (that is allowed to hold enemies)?

    Or check the position of your player (player.y) and run a enemy creation function that creates an enemy on a random platform 600 till 1000 pixels above the player (or other values).

    To do so just use system -> pick (platform) by comparison and compare the y-values.

    Or if enemies are to be in the air, just let the system create an enemy and set their locations in relation to your players position.

    like x: player.x+floor(random(400)) y: player.x+600+floor(random(400))

  • Well mate, how do you want them to move. Your description what you want to do exactly isn't very clear.

    For example you could set instance variables.

    Like a boolean "got_attacked" which is set to true when an enemy receives damage.

    Then add an event for enemy boolean instance variable is set and do the movement. You can ofc save the id of the attacker as well, then pick this instance to move the enemy toward or away from him.

    Movement itself can be done with the bullet behaviour (just attach a invisible sprite with bullet behaviour to enemies instead of giving enemies the behaviour, if you don't want the enemy to rotate into the direction it is supposed to move) or via the event system with the use of dt. Action would be sprite -> set position to sprite.x+dt*x and sprite.y+dt*x where x is your velocity in 1/60 pixel per second.

    Collision selection again can be done via instance variables. Just compare instance variables upon collision and run the according actions/function or use families (not in the free version) to separate between different kind of collision behaviour.

  • bscarl88:

    Try to fit a polynomial manually to your need with difficulty in mind. A spreadsheet program like Excel is useful for that. Example: s000.tinyupload.com / ?file_id=08472573822564563391

    More scientific approach: read into fitting polynomials (with Excel for example). Create a hp data point for some waves, then fit a polynomial to it.

mindfaQ's avatar

mindfaQ

Member since 12 Oct, 2013

None one is following mindfaQ yet!

Trophy Case

  • 11-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

13/44
How to earn trophies