Guizmus's Forum Posts

  • hello benadamswoo

    If I understand right, you want the player to click all the sprites in order, switching them to frame 8 if the player clicked the right one (the lowest in the array).

    I would change a lot in your capx to make it more flexible, but to just solve the current problem, the simplest way would be to rewrite the value of RND.At(clickedSprite). If you put, let's say 100, inside, it won't be the lowest one anymore, and will let other sprites get clicked then.

  • I never saw any tutorial on the subject, but there were some threads discussing this already if you do a little search. It's not that hard in fact, the harder maybe being the AI itself of the little guy : how will he react if he wants to eat and to sleep at the same time for example. There is a lot of decisions to be made to have a good game concept here. I recomand that you try to put the more you can on paper first, just to have clear ideas.

  • Basilboy

    Platform can be the way to go in your case, but a lot of adaptation should be done for the controls. First of all, deactivate the default key mapping. You will then need to make a big event where you check on current inputs, current animation of the sprite, and change the animation according to inputs. Then, you can use the "simulate controls" action of the platform behavior to control the movement of your sprite.

    It can be a lot of work for lots of animations though... I would personally do multiple events like "If left key input -> if currentAnimation = left, simulate left, else play left animation", ...

    It all depends on how you want to map your controls then.

    basicUser

    Don't use other people thread for your own problems, create yours. That said, you need to give more infos. Construct 2 will send your datas without problem using the "AJAX" plugin, and the problem is most likely in how you use this plugin, or in your server.

  • I think the pathfinding isn't made for finding paths outside of the layout. If it was, that means that a sprite could "choose" to go from A to B in a maze by running around it ^^

    That said, you have 3 solutions.

    First, you can make your layout bigger, letting them spawn inside the layout. You just have to set the scroll to the center of your level, so mobs spawn can't be seen and it looks like they walk inside the layout.

    Second, you can, after a mob spawns, make him walk inside the layout first and then look for a path to the destination.

    Third and last, you can change the spawning point. I just moved the "origin" point of your spawning zone and it works nicely right now : capx

  • You should link a capx when you have a problem you want help with, people can help you more easily and you will have more answers ;)

    If I understand well and your only problem is to reset both instance frame to 0, you just have to add a new event, using the "compare frame" condition on the sprite, just to compare it to 1. This event will select both sprites with frame number 1. You can then change the frame back to 0, if all your other conditions are verified.

  • Without the capx it's hard to say.

    Still, there is something that makes me wander : In the event 2, if the dt is too small (usually the case), the volumeMusic won't ever change from one tick to another because of the round. Why ? Because you substract like 0.2dB, then round it, making it the same again. Just try without the round, you can use floats as volume attenuation.

  • Toby12

    No problem :)

    I didn't optimize it though, as it was just a sample. If you add this on a lot of objects, be sure to use the scale instead (scale = height/width) with th same trick, initialScale being then a variable on your button. Less variables = better :D

  • Doesn't look possible right now, as there is no action doing it ^^ There are always workarounds like multiple spritefont with different align, and a variable to know witch is witch when you want to display text (so you interchange the spritefonts) but it's quite rare to need to change the alignment during runtime, no ?

  • random(1,3) outputs a number from 1 to 3, but with the random, you will never have 3 exactly, at most a 2.99 for example. When you cast it as an int, you don't do a "round", you take the int part of the number, making it a number between 1 and 2. What you want is this :

    ArrayAt(round(random(1,3)))

  • As there is no built in "choose name screen", you will have to make it yourself. What is the blocking point for you here ? It seems quite self explaining, 1 sprite per letter (or a spritefont), a selection cursor with a custom movement, a selection input that adds the current letter to the displayed name.

  • You will need 2 variables : currentDisplayedGold and currentGold

    When you give gold to the player, set currentGold to currentGold + newGold, and call a function "displayGold"

    This function will just check if the currentDisplayedGold is < to currentGold, then add 1 to display (and update the display itself ^^), wait 0.05s, and call the same function again.

    Here is the capx doing so : capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Toby12

    lerp is mostly used to animate over time, and as you use a trigger once, it don't work right here.

    2 solutions :

    • either you want the sprite to go full size/half size right away, and then lerp is of no use here. Just multiply the size by 2 or half it depending on what you need
    • either you want the sprite to go smoothly from one size to the other. A little harder to describe, you can find it in my capx :)
  • From the patch note of R137,

    dd     

    Query string ?nw can now be appended to the preview URL to force the engine to detect as node-webkit, e.g. localhost Useful for previewing quickly with node-webkit specific features.

    It wasn't possible before, you just have to change your preview settings to add the ?nw at the end :)

  • You could also call a function with the ChildFamily.UID that collided, and in this function pick the parent by UID using the UID you put in param.

    In this case, it's the same (as you would need a for each anyway to call the function on all children that collided) but in general it could be better, for example if you have multiple sources of velocity lost in your game. You would then just have to call the same function.

  • aznmonkeyboy

    I'm not sure there is another solution. Even with a plugin, you would still have to pick different objects and act on them as if they were the same, and only families let you do this.

    The solution I used before buying my personal edition was by making all my enemies the same sprite, using multiple animations and variables to identify what is what. It works but is not at all RAM & CPU friendly, as your events will all have to check on the variable "enemy.type" that you would have to add, and all the enemies would become "big" objects (if you want to add a behavior to one enemy type, you would have to add it to every enemies for nearly nothing).

    No, the good way to go is families, the "works anyway" way to go is all in a single enemy, the "I love pain" way to go is by doubling all your events like I did in the sub-event example I used.

    Glad you liked the help :)