Guizmus's Forum Posts

  • Reading the Fabulous Manual is a first step :)

  • Like Darklinki said, changing the project files during runtime seems... dangerous ?

    Most of all, if this is a webapp, modifying the project would modify it for everyone.

    I can think of a way, not sure it will work with every image though.

    What you need is the content of the image you load. So you have to load the image with an AJAX request, and save the lastData. Then, load the image from URL (AJAX.lastData). Don't put it only in the sprite, save it in one of the sprites variable, so it will be included in the savefile (making it a lot bigger though). On load finished, then Sprite : load image from URL (sprite.myvarible) should then bring back the image.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You need to post your capx if you want help.

    I'm not sure what you want, I know it's not easy but your English isn't simple to understand ^^

  • How did you do the Dynamic Shadows? Would you be up for sharing the capx?

    If not for the capx, any hint how you did it with such light CPU usage ?

  • If you add a condition "Trigger once while true" (you can find it in the System object, under the "special conditions" category) to the event that checks the sprite A current Frame, the event will only trigger once every time A hits his 4th frame.

    Here is a tutorial by Ashley on the subject, and other advance event features.

  • Well, it's not only capx, try it with xlsx or docx too ;) The nomenclature made me try, it worked :D

  • delgado

    Well, I moved the elevator directly by using a "move X pixel at the Y angle".

    You can replace it by calling a function "ElevatorMove", 2 parameters given (angle and distance) (add a 3rd param with lift.UID if you need).

    That function can then move the lift using whatever you want (8 direction behavior? custom movement ? everything is possible).

    As the "touch" isn't easy for the user to be precise, you can also just set a moving speed up if cranck is going on one side, speed down else, just to "smooth" things a little.

    I'm not sure I answered you, I may have misunderstood what you asked.

  • delgado

    Download my capx again, I added a textbox to set the "liftSpeed" variable on the go.

    I set the speed to 1 when I gave you my capx at first, but you just have to reduce it to 0.5, or 0.2, or whatever fits :) try some values with the textbox, then use the more appropriate one !

    Ho, and for anyone who takes a look at it, there are a lot of explications inside the capx, so you should be able to reproduce it/adapt it on lots of other situations.

  • I had 2 times a renaming bug too since r136, but wasn't able to reproduce it at will. Same problem though : renaming object (with sprites), save, close, reopen. When I looked into the capx with winrar, the sprite animation had a .rename after its original name. It seems to be the same here, this is the content of the "texture" folder in your capx :

    dropbox.com/s/xsp271eboejhu14/renameBug.JPG

    After renaming the file by removing the ".rename", the capx can open again.

  • Joannesalfa

    Love this way of explaining a problem :)

    I would just add a "hash*t" boolean on the arrow set to true when it first hits, and add a condition "X arrow hash*t" on the collision detection. This way, you can let your arrow go through the mob without destroying it and not trigger any other damage dealing after the first mob.

  • Hey,

    The solution to change the max speed and use a boolean to know if dashing or not seemed to be the good way to go.

    Here are the parameters that are to be tested :

    • dashing speed : how fast the NPC goes when dashing
    • dashing duration : not really its duration, but the coefficient to apply to "deceleration" during dashing, as default settings would create a very short dash.
    • running speed : the base speed to go back to once dashing is complete.

    Now let's think about the events. If an input is detected, if it's "space bar" (example), then player dashes if he wasn't already. If it's anything else, he jumps.

    How to know when the dashing is finished ? I used the fact that the player speed was at that point below the running maximal speed (and had landed), so the transition should be smouth.

    Here is how it goes in a capx.

  • NodeAtX/Y is the coordonates of the Xth point in the path calculated by the pathfinder. I take the last one : the destination. -1 is because arrays in js are 0-based, first element is on index 0. It can never be less than 1, because you always have a destination if the path is found.

    Even if I made a mistake, let's say -2, it would return Null, equivalent to 0 I think in this case, the cross would be at 0,0, but the sprite wouldn't move, it wouldn't have any path to follow ^^

    You can now see where they are heading. I couldn't correctly debug your code without adding some correct debug. The enemies were going somewhere slowly, it took decades to understand the problem at first ^^

  • Here is a little capx with a simple 3 events 3 objects to do what you described :)

  • delgado

    Your problem was fun to solve :)

    I didn't move any origin point, but I use a "handle" point and a origin point. I also had to use the "relative angle" of the sprite, the angle from 0 degree (original angle) and the handle, to synchronise with the touch.

    here is the capx

  • I coded what I told you, then cleaned a little, and it's nearly another code :/

    capx