Guizmus's Recent Forum Activity

  • If you really made 3 animations (white, fadeIn and fadeOut), you are storing frames for nothing. Use the "Fade" behavior on your sprite. To be exact, use 2 different "fade" behavior : one for the fadeIn, one for the fadeOut. On start of layout, run the fadeOut. On function "nextLayout", call the fadeIn and use the event on end of fadeIn to trigger the real switch to next layout.

    Also, if it works perfectly on the first layout but not when starting on another layout, try to export your project to see how it does. If you preview from the second layout, thinking the sprite would be in a specific state because first layout should have set it that way, the result won't be what you think. Running from start should help test more precisely.

  • Shapter You should put the file public, can't access your capx ^^

  • KMOBridge

    Hey again !

    I worked on your dropbox link, and there was already the bullet behavior, yes.

    You seemed to have some difficulties with the diferent controls though, and what you described could have been done with a lot of behaviors, like 8 directions, custom movements or bullet. I did all 3 in this example capx, with a menu to change the input type. Take a look at the event sheet to see how to use each controls well in you case.

    If you have any questions, don't hesitate to ask !

  • There is a new behavior since r134 that does that for you : line of sight. There is also an example doing exactly what you describe in the example folder. Its name ? "line of sight" !

    Enjoy :)

  • First of all, if you want help fast and useful, you should explain more what you need, and never ask someone else to do it for you. The point of the "How do I" forum is to learn by asking others for tips, not for the complete job.

    There is no example called "catapult", but there is a lot of physics examples that could help you too.

    That said, let's just think about what is a catapult and how to do it.

    There are 2 part : the catapult and the boulder. Catapult is a simple sprite, playing an animation when you click the "lanch" button, or whatever the event is in your case. The boulder is a sprite too, with physics. When the catapult lanches it, just apply a force on the boulder, depending on the settings you want for the catapult.

    Here is the simpliest capx I can think of to demonstrate this.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You are nearly there already ^^

    One thing to change only : don't set the bullet speed to 10, set it to (10-joe.Bullet.Speed).

    This way, if you are already moving, you will stop, and if you are not moving, you will start :)

  • TheNewGuy

    More tree part ?

    If you mean a higher tree, no problem.

    If you are looking for a tree with horizontal branches too, it should, you will have to create a "branch" sprite, and spawn it randomly every 3 successful growth for example.

    There is no need for any more sprite that this for the tree, as the tree can always be separated in 3 parts : the base, the middle and the top (top and middle being the same sprite : "treePart")

  • You got me interested but the plugin package don't work on r135 it seems, I can't test it :/

  • TheNewGuy Here is a capx example.

    Click on the ground to spawn a seed, it will then grow. 5 events. You can change speed and height with the globals.

    capx

  • Let's see...

    You could have something like this :

    globals :

    • treeGrowingTick
    • treeMinHeight
    • treeRandomHeight

    treeBase sprite :

    • isActive (boolean, true on create)
    • currentHeight (int, 1 on create)
    • targetHeight (int)

    treePart sprite :

    • treeBaseID (int)
    • initial frame is the top of the tree

    TreeSpawning :

    • spawn a "treeBase" sprite,
    • set targetHeight to round(random(treeRandomHeight)+treeMinHeight),
    • call "treeActualise"(treeBase.UID)

    on Function treeActualise,

    Pick treeBase by UID,

    if treeBase.currentHeight < treeBase.targetHeight

    Pick TreePart by comparaison (treeBaseID = treeBase.UID):

    • wait (treeGrowingTick)
    • set TreeBase frame to something more suitable
    • set treePart Frame to the middle of the tree
    • Spawn treePart at X=treeBase.X, Y=treeBase.Y+(treePart.PickCount+1)*treePart*height
    • set treePart.treeBaseID to treeBase.ID

    on Function treeDestroy (called with the treeBase UID as a parameter, making the tree base a good candidate for a "HP" variable ^^)

    Pick TreePart by comparaison (treeBaseID = treeBase.UID):

    • spawnLoot
    • treePart.destroy
    • treeBase.destroy

    As you can see TheNewGuy , I've written this directly on the forums, didn't test it. I hope it does the trick :)

  • In the Array Plugin, both IndexOf and LastIndexOf take only 1 argument : the value to search for, and I'm sorry to say there isn't, in the official implementation, a way to get the result of a search starting from the Nth index.

    Anyhow, if you don't know how many items will have the searched value, there is no use of having a list of all the index. Why ? Because to use them, you would have to do a forEach on the list/array. Why not just do a simple forEach on the first array, and do the full iteration only when the value matches what you are looking for ?

    Regarding the "too far" consideration, just know that C2 Arrays use javascript arrays to stock datas. Having a big array isn't a problem, as long as the total sum of the datas weight isn't excessive. Having 5k names isn't a problem. Having the base64 code of 100 pictures is. It all depends on how much data is in the array. Arrays are optimised since V8 for very fast access and writing, so lots of elements don't seem to be so problematic now. (more on this here)

  • Simpliest way I see is to set up 2 local variables in the ForEach loop, and saving at the end of each iteration X and Y of the new Leader_Flags.

    You can also pick the last created instance of LeaderFlags, but it won't be the best to manipulate...

Guizmus's avatar

Guizmus

Member since 26 Mar, 2013

None one is following Guizmus yet!

Trophy Case

  • 11-Year Club
  • x4
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

15/44
How to earn trophies