mikehive's Forum Posts

  • Your animation is great! I love it 👍

  • To be honest this question might be a bit outside the scope of this forum. You can use whatever you like to build the server side stuff - it's all the same to Construct (just grab things off the server with the AJAX plugin).

    I can't really speak to the merits of Laravel. Personally I would stick to vanilla PHP/MySQL unless you have a good reason to use something like that (most of the server end stuff you'll want to do will likely be quite simple eg. just pulling things out of a database). Most or all of that type of stuff is quite easy to do with straight PHP without needing to use any additional frameworks.

    But perhaps somebody who knows more about Laravel can weigh in on this :)

  • Dop2000 has given a fine answer - just wanted to add a tiny thing...

    Something I do a lot on big projects to avoid having to add lots of extra flags like "isDead" (sometimes I don't want to add a bunch of new variables for every small thing I want to do 🤷‍♂️) is to just set the health variable to a value that it can't otherwise get to through the normal gameplay process.

    Eg. If you shoot enemy & enemy health > 0: subtract 1 from enemy health

    Enemy health = 0: Play audio, set enemy health to -9999

    Now the health = 0 condition can only run once, and now I know that any enemy with health of -9999 has been marked by the system as "dead" - no extra flags needed.

  • You probably need to add a cooldown. Without seeing your events I'm just guessing, but I'm imagining you probably have the issue that when the user touches a button, the layer changes, and in the same tick, they are also now touching the new button since a touch is true for the entirety of the tick.

    Add a cooldown timer so the game will only allow 1 button press every second or 0.5 second or whatever and that will probably fix it.

  • Two simple ways that you might be able to fix what you already have:

    1. Add a check so that the left/right buttons only work when the sprites are NOT already moving.

    2. Add a cooldown timer to limit how often the user can press the buttons. Eg

    variable menuCoolDown = 0 at start

    if user clicks left / right & menuCoolDown != 1: Do the sprite move, set menuCoolDown to 1, wait 1 second, set menuCoolDown to 0

  • I'd generally recommend using a Spritefont object rather than Text in almost all cases for games. Native text is just too varied in how it renders across different devices (slight font differences on different machines, resolution problems, etc).

  • I think MegaMente may actually have been asking for a system that dynamically changes the colour of text as the user types things in at runtime, rather than just hardcoding BBCode in the editor.

    You could try doing something like this to process the user's text before it goes to the output text box:

    • Make a variable (userText)
    • put user's input in userText (from whatever you are using to capture it)
    • set userText to: replace(userText,"banana","[color=#FFFF00]banana[/color]")
    • set userText to: replace(userText,"apple","[color=#FF0000]apple[/color]")
    • etc
    • Set output textbox.text to userText

    This means that if the user types in "I'd like a banana but not an apple", your game will convert that into "I'd like a [color=#FFFF00]banana[/color] but not an [color=#FF0000]apple[/color]" before it shows it on the screen.

    Note that you might have to do a bit of work to cover word variants (eg. capitalised versions, plurals).

  • Oh, yeah, GA 4 is a bit weird with viewing live Events (honestly I haven't used it all that much). UA-xxxxxx id should work better.

    If nothing shows up under the live view, try checking back after 24 hours and see if your data has arrived.

    Honestly, I really hate GA4 (along with everybody else). I wish they would just put it back the way it was.

  • Do these objects have Solid behaviours?

    Have you set both of their collision polygons correctly?

  • I haven't used this plugin, but this looks like the setup for GA Event data (I use it a lot for work). Basically you can enter whatever you want in these fields, and that will dictate what you will receive in GA (under Behaviour - Events in the GA left menu).

    "Category" is the top level name of the event as you want it to appear in Google Analytics. You can set it up so that when you click on this name in GA, you can see a breakdown of all events in that category by Action.

    I would probably do it like this, but it's up to you:

    • Category: Track Play
    • Action: [Tribecore, Hardtek, etc)
    • Label & Value: [leave blank]

    As long as you make sure you send this data to the correct Analytics ID this should work just fine :)

  • Love your graphics style! Looks pretty cool 😁

  • What you're looking for here is event sheet includes.

    https://www.construct.net/en/make-games/manuals/construct-3/project-primitives/events/includes

    You can put each of your systems in a dedicated event sheet, and include them into whichever other event sheets you want them to affect :)

  • If you had an origin point at the inner end of the gun barrel (eg. where the barrel meets the tower) then I guess you could measure the angle from the turret to the enemy like so:

    And basically work out the angles like:

    If angle between turret and enemy is between 45-55 degrees: set animation to rightmost

    If angle between turret and enemy is between 55-65 degrees: set animation to middle-right

    ...etc

    Alternatively, for a more simplified version, you could compare the X values of the turret and the enemy. If all you needed was the 3 states of left/middle/right, you could work that out by testing to see if the enemy was more than a certain distance to the left or to the right of the turret origin.

    Eg. you could have these 3 events:

    If enemy.x < turret.x - set turret animation to LEFT

    If enemy.x > turret.x - set turret animation to RIGHT

    If enemy.x is between values turret.x-20 & turret.x+20 - set turret animation to MIDDLE

    This will cause the turret to point left or right if the enemy is to the left or right of its origin point, unless they are standing somewhere in the middle zone, in which case it plays the middle facing animation.

    I've allowed 20 pixels either way to be the turret's middle zone, but you can adjust this number based on the size of your sprites and what looks good in practice.

  • Maybe rather than updating the angle every tick, you can update it just a few times a second?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I must admit I constantly wonder why Scirra don't set up proper 301 redirects for all this old material. It's a bit of a facepalm that they've just let a decade's worth of links to legacy knowledge and insights get broken.