mindfaQ's Forum Posts

  • So since you found out there's a problem with the sprite getting set invisible every time, you have to find the line of code that sets it to invisible every tick (or whatever).

    To do that:

    use the search function (CTRL + F) in event sheets, use "set invisible" as search term (without the quotes). I suppose in one of your relevant sheets there will be an event setting your sprite to invisble.

    If there is none, then my only idea would be something like a (third party?) behavior or code, that somehow leads to that... but it's unlikely.

  • You have a C2-License, so start your layout in debug mode.

    Select the player sprite object. It should be marked with a red box around it. If you don't see the red box, the sprite's position is not within camera view.

    If you see the box, but no sprite is shown, check:

    the player sprite objects opacity, visibility, frame, animation, layer.

    If opacity is 0, you will not see it.

    If visible is false, you will not see it.

    Check in the editor if the current frame of the playing animation contains a visible image.

    Check the point of Origin - maybe it is far off the edges of your character's image and thus your sprites position is way off.

    Check if other objects share the layer with the sprite or are on a layer above the player sprite and if so, if they could overlap it (Z-Order).

  • Set animation speed of your sprite proportionally to your speed value. (probably in the event that determines/changes your speed)

    You find it under sprite -> animations -> set speed.

  • Your example didn't lag for me. But I think it is good practice to only run code when necessary.

    I'm not very familiar with the current learning ressources besides the manual. I think all the functionality besides own javascript plugins etc. is covered there. The examples of C2 give some additional hands on experience.

    I can't give the best tipps, because I'm not a pro myself.

    Important things to know (in no particular order):

    The hard thing currently for me is organizing and writing my code in a way, so that it is not (strongly) intertwined with itself. That's why currently I'm looking at some programming design patterns ( http://gameprogrammingpatterns.com/contents.html ). It might be hard to follow, if you are not comfortable with a programming language similar to C++.

  • perhaps like this:

    https://copy.com/q764O1j4hVDisxEY

    If you have multiple players, you would need to put the inventory and playersubstances array into the container of player.

    Doing stuff every tick like checking if any of the potions can be made or mobed really isn't what you should do, performancewise. Code should only run when you collect a substance imo.

  • Hmm, looks like construct doesn't create the subfolders physically but instead dumps everything into the same (main) directory.

    So one way you could do subfolders would be adding the folder names and files after export to html. But you will probably run into problems with other exporters, where maybe you can't change the file structure.

  • You stand correct.

    You can also use the native canvas screenshotting feature of Construct 2 for it (I think), but with it you will have to resize and reposition the screen for the screenshot to the resolution you need the image to have.

  • If you are talking about the images folder that construct creates after exporting (which contains the images of the sprites etc.): you don't need to change anything in your event system. The swapped image will appear in the game (possibly it could lead to errors, if the swapped in image has the wrong format).

    If you are talking about imported files: if you created a subfolder, you load the sprite from URL with: "subfolder/image.png", if not you can just load "image.png".

    If you want your users to dynamically store pictures in the game, you could build an editor in your game. A textfield could be used for pasting in urls from images, a file chooser for local images. Load the images to a placeholder sprite and then use the canvas plugin (or paster plugin) to paste the images onto the canvas/paster and save the base64-string of the contents to webstorage (or a database of yours). Everytime your user starts the game, the value will be retreived and loaded into the sprite (if it exists).

    Modifying animations will not be practical.

  • Yeah there is no problem, although I personally prefer the movements between grid positions to be smoothed instead of being instant, but that's just visuals.

  • mmmm i'm bad at math, and still have hard time to get it.

    Do we agree Lerp is a linear decceleration between A,B at the speed "factor" of C right ?

    I would not say that this is the case.

    While you can use lerp for smoothing in onto a value, that's not what lerp explicitly does. Lerp just returns a point between A and B, namely it returns: A + (B - A) * C. The smoothing you know comes from using a variable start point A, which normally is the current value that you are smoothing, so for example an objects x position.

    And the deccelaration of that lerp construction isn't linear, at start you will see a faster slow down until it comes to a not noticable crawl.

  • Yes, you misunderstood.

    If you do lerp between 0 and 10 with a factor of 0.6, then you will be at 6. I hope this part is clear? It would be lerp(0, 10, 0.6) = 6

    Now unlerp gives you back the factor of 0.6, if you give it the previous lerp result together with the same starting and end points. (unlerp(0, 10, 6) = 0.6)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 1) A collision check to detect mouse clicks over the button area

    2) Those are the stop positions for when the menu is supposed to not be able to scroll further up/down. So it depends on how long your menu is.

    3) All icons are in 1 image, mind that.

    4) one possibility: https://copy.com/umNSJFdVrFWUhtcu

  • Or you could just use LocalStorage instead of a deprecated feature.

  • You do not have permission to view this post

  • would be a bit simpler ^^