Notum's Forum Posts

  • 7 posts
  • Thank you! That's very helpful.

  • I noticed that the code block made things very hard to read so here's the pseudo code again:

    player = X,Y, 0

    target = X,Y, 100

    player.maxSpeed = 100

    player.steer = 5

    1. desiredVelocity (a vector) = normalize(target X,Y - player X,Y) * player.maxSpeed

    2. steeringForce (a vector) = desiredVelocity - player's CurrentVelocity (vector), limit (the magnitude of) steeringForce to player.steerForce

    3. newVelocity = player's currentVelocity + steeringForce, limit newVelocity to player.maxSpeed

  • Hey wonderful people!

    So, I've been trying to set up a basing steering behaviour in Construct 3. The issue that I'm having is that Construct does not seem to have the ability to work with vectors.

    How can I use the tools that Construct gives me, and most likely some math, to replicate the results of using vectors.

    For instance using vectors and some variables for max speed and acceleration I could create a "seek" behaviour like this:

    player = X,Y, 0 target = X,Y, 100 player.maxSpeed = 100 player.steer = 5 1. desiredVelocity (a vector) = normalize(target X,Y - player X,Y) * player.maxSpeed 2. steeringForce (a vector) = desiredVelocity - player's CurrentVelocity (vector), limit (the magnitude of) steeringForce to player.steerForce 3. newVelocity = player's currentVelocity + steeringForce, limit newVelocity to player.maxSpeed

    This would create a simpel seeking behaviour where the player would smoothly follow the target.

    How can I use the tools that Construct provides me to achieve the same sort of thing?

    R0J0hound Your posts have helped me many times in the past. Do you have any sage advice on this?

    Thanks!

  • Thanks! Sadly the ships will rotate freely. It's a top down game with where the ships can be at any angle. Your solution looks like it would work great for a side on game though. Again, thanks for taking the time to answer this.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for taking the time to answer!

    Since you have to manually place the image points yourself anyway, why not add 2 instance variables to the sprite and store the count for left / right image points there?

    Great point, and it's what I've ended up doing but it does feel a few steps removed from what I'm trying to achieve.

    Can you give any more information about what you're attempting to create? Perhaps we can find a better way to do it :)

    Sure!

    What I'm trying to create is an easy way for me to quickly specify where I want specific objects to be created based on a sprite. I want to be able to do this in as few steps as possible since I will need to repeat this for each sprite of this type that I add.

    What I'm looking to achieve:

    • I have several sprites representing spaceships.

    • Each spaceship has a number of spots where I want to create certain effects like turrets, thrusters, weapons, and so on.

    • By setting up image points on each sprite, named in a structured way I hoped to be able to create these effects by referencing the image points by name.

    Here's a screenshot of what I have right now. The main issue is the Repeat condition. Currently it's manually set to 2. Ideally it would be dynamic based on the number of image points that match a criteria.

    I'm totally open to other ways of achieving this. In my head, the imagePoint method just seemed like it would require the least steps.

    Thanks again!

  • Hey wonderful people!

    I'm wondering how I can get a count of image points by name.

    Say I have a sprite with some image points named: "left_0", "left_1", "right_0", "right_1"

    I want to find how many image points that contain "left_". In this case it would be 2.

    The reason I need this is so that I can use that number in a Repeat condition to create objects.

    Things I've tried:

    • regExMatchCount on the sprite.imagePointX... but this, of course only gives me the x-coordinate of an imagePoint.

    • picking in various ways but I can't find a way to correctly reference an imagePoint

  • I created this radial menu but it turns out it's not ideal for the game I'm making at the moment so I figured someone else might find a use for it. I'm by no means a Construct expert, in fact I'm a newbie, and the code is probably not very optimised but hey, it works.

    What is it?

    A radial menu with support for "any" reasonable number of items.

    Pretty customisable as far as number of items, colour and size.

    Feel free to use this in your project if it fits your needs or pick it apart and tell me if it could be improved.

    Download .c3p here

  • 7 posts