oosyrag's Forum Posts

  • That's up to your own style or workflow. If you need to randomize your enemies or generate then dynamically, I would create them via events.

    Or if you like/need to place them in the layout editor for level design purposes, then just set the variables manually then copy and paste.

    You can also just set a single instance variable "monster type" when placing on the layout editor, and adjust all the other variables based on that by event on start of layout similar to how i described with a function. This will make it easier to make changes and adjustments later.

    Really is up to your own preference and what is most suitable for your game.

  • For an even chance of spawning all monsters within the specified level range, I would use a second array. The first array would contain all monsters, the second array would be generated to contain monsters eligible to spawn.

    You would use a for each x, and check the level at curx,1 to see if it qualifies, then push it to three second array if it does. After all qualified entries have been added to the second array, you can use floor (random (array2.Width)) to pick a random index from the second array.

    For a brute force method, you can pick a random index from your main array, check of the level is within your criteria, and repick if it is not. But this method can be inefficient.

  • That looks about right. Although there is a bound to layout behavior that seems more suitable for what you described.

    I'm not certain about the effects of the layout scale, but that should be easy to compensate for either way, as there is a layoutscale expression you can use as a multiplier if necessary.

  • [deleted]

    EDIT: Never mind what I said previously! Different approach has been found as per your requirement.

  • Assuming your different values are instance variables, you can create a function to spawn enemy with a parameter "enemy type". In the function, seperate out if enemy type=a then set certain variables, if enemy type=b then set variables, ect.

    Create your behaviors based on each enemy's instance variables.

  • No noticeable difference.

    Edit: Loops can cause issues if you are not careful with them.

  • It may be better to just stick with a simple variable, if you don't need to store much information about each entity in the queue. Here is an example - https://www.dropbox.com/s/mz3e0ys26mfo5 ... .capx?dl=0

    For multiple queues, it will be a smart idea to use an invisible helper sprite to mark the start of each queue. This helper sprite can also be used to help position new customers and keep track of queue size. You will also be able to associate each customer with a particular queue by saving the UID of the helper sprite.

    I'll get back to this and update with a better example when I have time.

  • Sorry messed up a bit on the math. Here is a partial example:

    https://www.dropbox.com/s/6j58ma2hlg7z2 ... .capx?dl=0

    Some issues that need to be addressed:

    Sprite jumps to cursor upon first click - Can be adjusted for by storing the difference between Mouse.X and Sprite.X in a variable

    Doesn't work with 90 or 270 degree angles

    Only works on X motion - Both of these can be fixed by making a second version that works on the y axis, and utilizing proper conditions to choose which one to use based on mouse movement.

  • You could keep track of each sprite in an array, which gives you lots of options for queueing by using the push and delete actions, or you can use a variable to keep track of the queue size and use that as a multiplier for x position when spawning.

    The invisible sprite idea is also acceptable, but is limited to a fixed amount of positions. If you're worried about too many objects being clunky to work with, you can use one stretched out line with multiple image points instead.

  • To do so, you'll need to save the originalposition of the object in variable when you start dragging, then set object position to x, y where x is mouse or touch.x, and y is tan(angle)*(mouse.x-originalx)+originaly

  • Just an idea, but in the event that you are not running full screen (allowing your mouse to get off the window), try having a couple pixels of dead zone right around the edge that does not scroll. If you are full screen, I think you would not want this dead zone, but there are conditions to take care of that.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Try a bullet behavior with randomized angles as well to make it move.

    • Post link icon

    Whenever they are ready to.

  • Add event, on overlap wall set speed to 0.

  • It can be done with a little creativity, but not in a single textbox. Build your text one letter at a time with seperate objects.

    https://www.dropbox.com/s/211xd1ir76hq8 ... .capx?dl=0

    In the example I used a text object, but you should definitely use spritefont. Also, you can use a loop instead of every x seconds to get rid of the typewriter effect.

    To simplify things, you can have two spritefont objects - one red version one black, and just create the suitable one with conditions. You can trigger the color change and end with an escape character in your string that doesn't actually get displayed.

    Edit: Alternatively, you may want to look into positioning a tint layer effect over the words you want colored...