New to Construct 3: Looking for some help with a few issues.

0 favourites
  • 11 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hello! As the topic says, I'm just getting started learning Construct 3 and I'm loving it so far. I'm not a programmer (though I've had exposure to programming in the past) but just trying to live out the dream.

    I was hoping to find some answers on a few subjects that are stumping me at the moment. I decided to start my endeavors with an infinite runner as it seemed like the code was simple enough to execute, yet could be complex enough to teach me new concepts bit by bit as I enhanced on the initial project. So far, seems to be working that way.

    The issues I'm stuck on are the following:

    1) My runner character is running across an invisible rectangle that it rests on. For some reason, my character shakes a bit as it moves through the animation. All of the frames in the animation are a perfect square (64x64), and the shape it runs on is solid and flat, so I'm not sure what's causing it.

    2) My controller inputs seem to be lagging a bit or completely unresponsive, but I can't tell what's causing it. It might be due to number 1 above, because my character doesn't think it is on the ground and therefore doesn't have the ability to jump, but it's definitely not the intended result.

    3) I cannot, for the life of me, figure out local storage. I have code right now that after the player dies, the score is copied and moved to a High Score text area. I then wrote in to save that (tried both Local Storage and Dictionary) but both options don't seem to work when the layout is reset (I make a call for both at the start of the layout but it just erases it). Anyone who can shed some light here, even if it's just a direction to head, it would be greatly appreciated.

    I'm linking a video of the gameplay here so you can see the issues. Of course, in the video my jumping worked fine which makes me think that it had something to do with the fact that the window was overtop another window. Oh well.

    1drv.ms/v/s!AiVeBY7VF_G_hqYc07bUFxvQj2ZP5w

    Thank you!

  • 1) Check the Origin image point of the sprite.

    2) You can place an invisible ground let the Platformer can jump.

    Or use 'Tween' Behavior to make the movement animation .

    3) You can look at this Example and learn how to use Local Storage plugin to make local historical high score data.

    editor.construct.net

  • Thanks for the advice Some feedback:

    1) All sprites for the player character are 64 x 64, and the origin point for all of them is 32 x 32. Should it be somewhere else?

    2) I mentioned that I am already doing that. :) However, I noticed the issue doesn't seem to happen when I don't have a window behind my test window, so I think it's a bug with how the software works, so this is probably a non-issue.

    3) Thank you! I'll take a look right now.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Excuse the phone screen shots but here's a couple of an example of a simple local storage

    On the start of layout check the localstorage key exists. If it doesn't, set the key (in my example I needed 0, so for a highscore you'd want 0 too), then check the key exists again (which it now will)

    Then on key exists - get the key.

    Then you can set your global variable to the key

    Now you've sorted the loading of the localstorage key you can think about saving the variable as local storage

    Localstorage - set variable to localstorage key

  • MrClifford, no worries at all! Definitely get posting however you can lol.

    I really appreciate the help here and even more, the descriptions of why you did what you did. As a learning person, this helps so much with understanding conceptually, not just copying and pasting the logic. Thank you!

  • No worries, that's only a simple way without using arrays etc, but the basic logic still stands - check, get, set.

    As for your other little issue, like XHXIAIEIN said, check your image points. 1 pixel down on 1 sprite can cause this, or it could be the collision points. Make sure the collision points are all on the same Y - again, if your collision point is set one pixel higher than the other frames, it can cause the issue your experiencing

  • MrClifford You can actually access LocalStorage.ItemValue in the "On item exist" event. No need to use Get/On Get.

  • MrClifford -- Much appreciated. As for the collisions, I have a comment to the person above talking about image points but it's still pending for some reason. I checked the sprite of the player and every frame for everything it is doing is 64x64, and the rectangle it runs on is just that: a perfect rectangle. I honestly don't know why it's bumping up and down.

  • MrClifford -- It was my collision points! The origin and sprite size are uniform throughout, but the collision points that were generated were a mess. I'm going to adjust those and I'm willing to bet that fixes it.

  • Good stuff, hope it all works out and worth checking the poly whenever you pop a new sprite on that's going to have collisions.

    Loving the simplicity of the graphics btw, looks cool

  • Just circling back to update you all: I was still having a ton of trouble with saving and loading high scores until I realized it wasn't the code about saving and loading, it was my own dumb fault for setting the global variable to 0 each time the game loaded. So no matter what the backend saved the score as, the player always saw 0. Whoops.

    That being said, the core functionality of my game is done, and I've got navigatable menus (even though they are empty). I commissioned a guy to provide me with a few more assets (he worked on the originals too), so I will continue to code the rest as I wait for those, but I'm ridiculously excited to see this come to life. It may be simple, but I have learned so much already off just this one project. I can't wait to do more.

    Thanks to everyone here for the help!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)