zatyka's Recent Forum Activity

  • Ah...understood. One option that comes to mind is creating a placeholder sprite, and putting it in a container with all the body part objects. That way, you only need to add a single placeholder sprite to the layout, and all the body parts will be created with it at runtime. Of course, that may require some extra work as all the body parts will all load at the same coordinates.

  • Hi All,

    I'm working on a saving/loading system for my game. Right now, I store instance variables in several objects. I'd like to be able to save these values to an array, stick the array into storage, and at a later time, load the array from storage, and reassign all the instance variables.

    I'd rather not have to manually code each different object's instance variables being added to/loaded from the array as some of my objects have quite a few instance variables. It would be handy if instance variables were indexed, and there were an expression to reference them by index. That way, I could loop through each instance variable's index to save to/load from the array.

    A work around I've been thinking about is getting rid of instance variables altogether, and just using arrays. I would create an array per object to hold the values that are currently stored in instance variable. That way, I could loop through the array to save/load these values. I guess my questions is, "Has anyone found a better method for saving/loading values associated with objects"?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Click on an Object in the Object Bar or Project bar, and it should automatically highlight all instances of that object in the current layout.

  • Setting the game's timescale to 0 is usually a quick and easy way to pause a game.

    Delta-time and framerate independence

  • It's very hard to recommend any course of action without having a frame of reference. What exactly are you trying to accomplish? What is a unit? Are Score, Move, Kill all variables? If so, global variables or instance variables?

    The more info you provide, the easier it is to help.

  • Controlling animations is something completely different. Since it's such a common element of games, there are many existing resources to learn from. I highly recommend checking out some C2 tutorials, and the "How To" topic, to really learn the basics of C2.    

    Here's an example of one way to control animations when using the bullet behavior:

    If Sprite.Bullet.AngleOfMotion is between 45 and 135 degrees

         Set animation to Down

    If Sprite.Bullet.AngleOfMotion is between 135 and 225 degrees

         Set animation to Left

    If Sprite.Bullet.AngleOfMotion is between 225 and 315 degrees

         Set animation to Up

    If Sprite.Bullet.AngleOfMotion is greater than 315 or less than 45 degress

         Set animation to Right

  • Here's a slightly different approach:

    Demo

    Capx

  • GodSpear

    I think you'd have much better luck getting help if you write out exactly what your goal is. For example:

    "I want the player to be able to click somewhere in the layout, and then the HeroMale Sprite follows a path to that spot. The HeroMale Sprite should move in a grid, so it only moves up, down, left, and right."

    I'm guessing that English is not your native language, so just do your best.

    Referencing another game's behavior (WarSpear Online) requires us to know how that game's movement works, and severely limits the number of people who could help you. Based on what you've said so far, I think I know what your goal is. Check out this Capx:

    Capx

    I hope this helps.

  • I'm really not sure what your desired goal is, but this is what I see:

    1. You have one instance of a bullet in your layout. Since the bullet sprite has a bullet behavior, it immediately moves right (it's starting angle) as soon as the layout starts, and ultimately collides with a dest sprite.

    2. When the bullet hits the dest sprite, you have the player sprite's position set to the bullet's location, which is why the player appears to "jump".

    Again, I'm not sure what your goal is, but it may be simple as adding an action on the start of layout to destroy the existing bullet sprite.

  • Joannesalfa

    Thanks for the interest. Any estimate of the project's completion date would be an educated guess at best. The engine is finished for the most part. Right now, I'm focusing on writing out the game's storyline/puzzles. When I have something worth showing, I'll most likely create a topic on the forums here.

  • I think the action you're looking for is "Set Focused".

  • I've been meaning to mess around with auto-tiling in Construct 2, and this gave me an excuse to actually do it. Check it out:

    Demo

    Annotated Capx

    Just like the article you linked to, I'm only setting a tile's frame based on the tiles above, below, and on either side, so some of the corners don't look quite right. The fix is to base the tile's frame on the 8 surrounding tiles, but it would require 256 individual frames (which I didn't feel like making).

    Just for fun, I have the TileMap save/load from webstorage.

    I hope this helps.

zatyka's avatar

zatyka

Member since 11 Aug, 2012

Twitter
zatyka has 1 followers

Trophy Case

  • 12-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • x11
    Coach One of your tutorials has over 1,000 readers
  • RTFM Read the fabulous manual

Progress

15/44
How to earn trophies