mikehive's Recent Forum Activity

  • After doing a little more digging/detective work, I may have partially answered my own question. It seems that the game loads and runs after pulling the correct 7MB of data, then downloads the additional duplicate stuff after launch.

    The console gives me the message: [SW] Caching 34 files for offline use.

    So, it seems the redownloading of files is due to the game caching itself (hence why it loads very quickly at the next refresh) and doesn't impact the initial load time as the game is already up and running while it is doing this in the background.

    That's cool with me - it doesn't affect the initial load speed and in fact improves load times thereafter.

    I just have a small remaining question about the caching - this seems like it creates problems when I update the game.

    As a test, I made a small change to data.json and reuploaded it (in this case, I made a small alteration to one of the on-screen text elements). Then when I visited the game page, the change was NOT reflected until I cleared my cache.

    I intend to update this game a lot - how can I make sure the cache is only used when the game hasn't been changed since the last visit?

  • Hey folks.

    Currently working on a little app that I am considering hosting on my website for users to access in the browser.

    In particular, I'm keen to keep download sizes / loading wait times to a minimum, so have been doing a few tests.

    Bizarrely, the total size of my exported HTML5 game is around 7MB. However, when I upload the app and visit it with a Chromium browser, the browser seems to somehow pull down 12MB of files. Looking more closely into it, it seems that a lot of the PNG assets are somehow being loaded twice?

    Anybody have any idea why this is happening? The app isn't anywhere close to complete, so it's worrisome that loading times are already double what they should be. What's going on?

  • Yes, or just set it to something else that doesn't cause problems with your existing events. Set it to +999999 or whatever.

    It doesn't matter either way - dop2000's answer will work fine for you. I just wanted to add that sometimes when I'm doing a lot of complicated work in the event sheet and am in a flow state, I don't always want to go to the layout view or the project bar, find the right object, and add another instance variable to it - it breaks my concentration - sometimes it's just faster to use the variables you already have to hand to get something done quickly :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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?

mikehive's avatar

mikehive

Member since 13 Jul, 2015

Twitter
mikehive has 2 followers

Connect with mikehive

Trophy Case

  • 9-Year Club
  • x4
    Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

11/44
How to earn trophies