aerirprown's Forum Posts

  • sgn15 You could use a boolean variable "ready" that you check whenever there is input. If it is true then you proceed with the input.

    Then you could set it to false when the character is performing a complex action that should not be interrupted.

  • I got it working using Ashley's suggested method.

    I offer 2 save slots in my game. On main menu, there are 4 buttons. 2 to clear each of the save slots. And 1 button for each save slot. Each save slot button has 2 frames. "New Game" and "Continue".

    On the start of the main menu layout, I check web storage to see if the key "save1" and "save2" exist. If it does, the corresponding slot button is changed to "Continue". I have 2 variables, save1Exists and save2Exists. If the web storage key exists the corresponding variable is set to 1.

    When either of the save slot buttons are clicked, the system checks if the corresponding saveExists variable is set to 1. If it is, I have another variable called "savedGame" that is set to the value of the web storage key of "save1" or "save2" depending on which button was clicked. Then I load the game from save slot savedGame. The game is only saved at the main layout.

    If the saveExists variable is not set to 1, I set the web storage key "save1" or "save2" to "myGameName(1 or 2 depending on save slot)". I then set the savedGame variable to this web storage value. Then I load the main layout.

    When the main layout loads, the game is saved to save slot savedGame. This main layout is more of a hub layout for the player to move between doing missions, purchasing upgrades and such.

    There may be a better way to do this but, this worked for me.

  • Thanks for the replies. I will give it a try and report back.

  • Has anyone used the full state save/load feature successfully?

    I can't seem to figure out two things.

    1. Check whether a saved game exists. I read that you can use web storage to check, but it does not appear to work.

    2. Clear saved games.

    Do you just have to use web storage instead of the full state load/save?

  • I would do it something like this.

    Function placeTurret

    Set prototypeX to random(layout.width)

    Set prototypeY to random(layout.height)

    If distance(prototypeX, prototypeY, player.x, player.y) <= turret.range

    ------->call placeturret

    else if prototype variables are outside layout

    ------->call placeTurret

    else set turret x/y to prototypeX/Y

    This way the function calls itself until an acceptable value is found. You would initiate it by calling this function upon creating the turret.

  • I had a large animation(large in pixels not frames) that made my game stutter for a second when it was created. So I just spawned it on the start of the layout and toggled between visible/invisible and placed it in the correct place.

    That way you could avoid constantly creating and destroying the animation.

  • The way I would do it.

    Spawn the object off screen. The object would have variables prototypeX and prototypeY. You would perform your placement calculations on those variables and check if they would be acceptable(on screen and out of range of the target).

    If the prototype variables are acceptable then set turret.x and turret.y to the prototype variables. If not redo the placement calculations on the prototype variables until you have acceptable values.

    You might have a system to note why the values were unacceptable and seed the recalculation accordingly.

    You could bypass the prototype variables and just move the turret around until placement is correct, but on the off chance the game slowed down during that moment, the moving turret might be seen.

  • I am fairly certain that all a sprite's animations are loaded when it is created. If you have multiple instances of the same sprite, though, it does not load the animations for it multiple times since the animations are already loaded from the very first instance.

    I've seen many people recommend using one sprite for objects that behave the same. So I think you are following good procedure.

  • I have seen it mentioned that any graphics we import, should already be the correct size before import. I had already decided to remake most of the graphics for my game so I made sure they were the correct size before importing. I also did not crop them within the C2 image editor.

    I notice that even if I resize images within C2, the image files exported for my C2 project appear to be the size that I resized them in the image editor. Can anyone confirm whether resizing images in the C2 editor affects performance. I do not mean resizing during the game.

    Another performance question I had. Does having collision enabled on objects that will never use collision, and are never checked for collisions affect performance? I am just wondering because I did not know if C2 did a behind the scenes check.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think the idea of community meetups is a good idea. I would not be able to attend due to distance, but I am sure the people who are able would enjoy the opportunity.

  • Wow that was a silly mistake I made. Thanks, Blackhornet.

  • I have a very simple project that creates an impulse on the rectangle towards a click/touch. The rectangle encounters a nonexistent barrier when two conditions are met.

    1. The rectangle has Scroll-To behavior.

    2. The layout is larger than the screen size.

    The barrier is essentially a right wall near the middle of the screen and a floor near the middle of the screen that it cannot move past. I have only tested in Chrome.

    If I remove the Scroll-To behavior it works fine. If the layout is the same as the screen size it also works fine.

    I was hoping to have levels larger than the screen size and have the screen scroll with the player. Any one have an idea what the problem is?

    Let me know if the link does not work.

    dropbox.com/s/tt8k15w7wlvkk0g/Empty.capx

  • thenextweb.com/dd/2012/08/28/check-mozilla-pushing-html5-gaming-3d-first-person-shooter-demo

    Thought that might be interesting. I'm not sure it is actually uses HTML5, though. It says that it runs with Javascript and WebGL.

  • Here is mine. newgrounds.com/portal/view/615488

    I still have lots of work to do on it. Any feedback is appreciated.

    I voted for a better tile map support. I think all of these would be great improvements, though.