pcprice76's Recent Forum Activity

  • In some (but not all) situations there are gains to be made in performance by limiting the total number of different sprites objects in your game, but there are also other good reasons for containing multiple objects on a single sprite, mainly by making your project a little more readable and simplifying the code requirements.

    There are a few factors to consider before determining what the best solution would be:

    1) I would tend to only include objects on the same sprite that appear on the same layout as you would otherwise be filling up your memory for each layout with unnecessary art assets.

    2) I would only include objects on the same sprite that have simple behaviours and use the same basic logic e.g. all inventory items, otherwise your code will become overly complex trying to differentiate between the objects when you could instead just refer directly to a specific sprite.

    3) If there were groups of objects that appeared on different layouts with similar behaviours, or objects with quite complex behaviours and multiple animations on the same layout, then I would prefer to put them on separate sprites and add them to a family so that I can still use the same code groups to control them.

    4) In certain circumstances I would use the individual frames on a single animation for different objects e.g. scenery objects, non-animated pick-ups. This also makes it quicker to import graphics as you can import a sprite strip to a single animation instead of individual frames to separate animations.

    5) It is much easier to perform actions like spawning random objects when they are on a single sprite: for example, if I had 10 pickups and wanted to spawn a random one then if the pickups were on separate sprite objects I would need to assign a random number to a variable to determine the pickup and then have a string of 10 conditions to spawn the correct one; if instead I had each pickup on a single frame or animation then I just spawn the sprite and pick a random frame or animation - 2 actions on 1 event as opposed to 10 conditions.

    really thanks for your reply!!

    I thought the same about "organisation" of all my sprites, would be better. The only thing i would like to know if there can be a difference in performance using different sprites instead one.

  • In less words.. For items in an adventure game is better a single sprite with different animations for every object or is the same to use a different sprite for each one of them? If better to use one sprite, what is the reason? Thanks

  • Hi, sorry for the noob question. I'm trying to do an adventure game and i'm using sprites with instance variable "name" to identify them in the XML file

    I think that probably i'm doing it the wrong way, if i understood well it would be better to use a single sprite and an animation with the name that will be used in XML in place of variable one. My question.. is really better to use a single sprite with multiple animations for different objects and, above all, what is the reason?

    Thanks in advance,m also for you patience, and sorry for my english!

  • Hi, i'm trying to understand better how to use Load from Json in C2 but i'm a little bit confused by now.

    I understood the general concept and would be able to copy and modify an existing one, but i would not be able to create one from beginning. I would like to understand how is formatted, the meaning of all those "" and so on. Tried to search over the manual and tutorials, but did not find anything. Is there somewhere an explanation of it? Thanks in advance!

  • HI, i tried the plugin without success unfortunately. First tried the demo with rex login data, then also tried to register on firebase. The login fails im both cases

    Error is "auth/popup-closed-by-user"

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • file not found

  • Local storage is for keep values like bestscore, lastuser, etc.

    I think save and load is for this case.

    https://www.youtube.com/results?search_query=save+and+load+construct+2

    I think i'll use Save Game only in test environment, because i noticed some limits. for example, i didn't find a way to check if a savegame exist (but maybe i'm doing something wrong)

    Then i noticed something weird if i close game during a "wait" inside a function...

    I think i'll finally use local storage to save the Array and Character position

  • Yes. i'm trying to use that one. Seem to work

  • mmmh, not sure that save and load feature can be used with Local Storage

    My game should auto-save after every action taken, but the

    'LocalStorage --> On item "autosave" exists' does not seem to work, if Autosave was created with "Save" action...

  • I must thank you both... you gave me great help, thanks!

    Trying now..

  • I'm developing a graphic adventure and now i need to find a way to save the room so when the game starts will not build the level from the beginning each time. I have all the start configuration in an XML file with all the text strings. I should check, at start of layout, if is the first time that game starts and if not, skip first configuration and, instead, loading it from local storage. Wich is the best way to do it?

    Thanks!

  • pcprice76

    There are a bunch of ways to make it do what you want... it depends on how complex your project is. If there is a lot going on, and you want to pause all that and enter a different state, then you would want to put code in different groups and disable groups you don't want running. (that would disable the sprite that creates the m.Glass one, so you don't have to worry about it processing a tap).

    The most simple way is to just make sure the m.Glass sprite is not overlapping the other sprite. I made a quick example of that...

    http://www.rieperts.com/games/forum/Tap.capx

    Hi, sorry for replying you late, but you gave me really good hints!

    I will for sure use the Group disable feature in some parts of the game, i nvere noticed that before :/

    My first idea was to make M.Glass appear beside the touch.x, but i want to solve the issue the same, because it will appear overlapping some other objects.

    I tried now to put another confition (if M.GLASS is not on layout 0) but... is really, strange, it doesn't work even if is correct...

    M.Glass is not on layout and event is not triggering the same.... really weird...

pcprice76's avatar

pcprice76

Member since 6 Jul, 2014

None one is following pcprice76 yet!

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies