hrisnz's Recent Forum Activity

  • Here we go <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    https://www.dropbox.com/s/ruzmghista1pn ... e.c3p?dl=1

    This is the solution mentioned in my post above. It works. But it has a tiny delay <img src="{SMILIES_PATH}/icon_e_sad.gif" alt=":(" title="Sad">

    Any optimisation tipps?

    Explanation:

    • Left, right arrow rotates the player
    • Up and back arrow accelerates
    • Press E and R to rotate the level ... and see how the custom shadow repositions itself according to the levels rotation and the new true angle (rotation will be done automatically later) - E is a lot faster for testing purposes

    My goal is:

    • To set the "Custom Shadow" to the players true rotation (level gets rotated, player doesn't, the shadow should still rotate) ...
    • ... so I can place the shadow on a different layer since I want to set its blend mode to "source in" and place all "ground" elements on the same layer to have the shadow only be visible on the ground objects but not the rest.
  • It might be a possibility to just make a "start screen"?

    Touching "Start" causes the mobile event to start and clicking it runs the desktop event.

    Hope this might help

  • Cmd + R is my best friend while testing in a new browser tab - or multiple.

  • EDIT:

    Ok, one night of thinking brought me to the following:

    It would be really useful to have an easier way in C3 to detect the true position of an object and its true angle (with true I mean on canvas, incase separate layers are rotated for example).

    Using the CanvasToLayer method works, but it only gives the "true" position of an object for one different layer. So if you need to translate multiple objects to multiple layers it can get quiet confusing.

    And there seems to be no direct way to detect an objects true angle (on canvas).

    Regarding the whole true angle issue, I figured it might be a possibility to "pin" an object (for example) behind or in front of the player object, detect the players position X,Y through CanvasToLayer and detect the pined objects position X,Y through CanvasToLayer and set a third objects width to X=PlayerX,Y and Y=PinedObjectX,Y and its angle to ..... mmh wait. But you get the point: the goal is to translate the true angle of the player object to a different layer by detecting two points "on" the player object, so a third object can mimic those two points, creating the true angle on a different layer.

    Does anybody know how I can set the "third object" so it uses the two CanvasToLayer coordinates to create the true angle of the PlayerObject?

    I'm thankful for any help

    Best,

    Chris

  • EDIT:

    Or is there a way to show/render/blend/view Sprites only on certain objects (on different layers) this would make creating custom shadows so easy!

  • Hello Scirra Community,

    is there a way to detect an objects real angle?

    Example:

    Layer 1 = Sprite 1

    Layer 2 = Sprite 2

    • Sprite 2 is set to Sprite 1 + offset (to mimic a shadow)
    • if Layer 2 gets rotated, Layer 1 naturally doesn't
    • therefore setting Sprite 2s angle to Sprite 1s wont work anymore.

    I came around this problem with positions using the fantastic function of LayerToCanvas and CanvasToLayer.

    Is there something similar or a workaround to detect the "true angle" in relation to the canvas?

    Thanks for any advice and help

    Best,

    Chris

  • 99Instances2Go

    LOOK AT THIS BEAUTY <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">:D:D:D:D

    https://www.dropbox.com/s/lz6ru0uhvcg93 ... 3.c3p?dl=1

    oh man, I must say it took me a couple of good hours of frustration. But finally I managed to understand and execute your advice.

    Anybody who wants to try it:

    • Press U to lerp the circle to the player
    • Restart Layout
    • Press R to rotate the "rotating layer"
    • Press U now AAAAND THE CIRCLE STILL lerps to the player <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">))))

    a bit odd how happy something like this makes me <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

    Thanks again and again!

    #solved (lerping position of two objects on different layers when rotated)

  • EDIT!!!

    Aahhhhhhhhhh. I see: The third attempt is working. But if the "new sprites" spawn at the "old sprites" location (even if it is on the player's layer), they will still spawn at the old sprites "location" in the old coordinate system. And therefore work but start of at the wrong place (old sprites location)

    So your way should indeed work!

    To me it seemed the same. But now I see its not

    I will keep you updated

  • Good morning 99Instances2Go,

    I was experimenting last night and this morning and came to the following:

    • I didn't try your attempt yet (because actually I'm afraid it wont work). Let me explain:
    • What you said and your solution seems perfectly fine and will probably work for detecting the "real" coordinates over multiple layers with different parallax
    • But doesn't this mean it should work with object on the same layer (in the same coordinate system)
    • So to try if your "right" way will work I thought about this:

    1. attempt: On event - move collectable to same layer as the player + set position to perp(self,player,x)

    https://www.dropbox.com/s/lqse3r6v6210g ... 5.png?dl=1

    • But it seem (when rotated) to still stay in its "own" coordinate system. So i tried this:

    2. attempt: (You can skip this one actually since I changed this version in attempt Nr. 3)

    • Created a new object (which will be the collectable in its active state) /like a different coloured clone
    • Gave it an instance variable (0)
    • On (collecting) event: set instance variable to 1
    • If instance variable = 1 set "clone's" position to perp(self,player,X)

    + trigger once while true: Old collectable - Spawn - "clone" on "Player's" layer

    • destroy "old collectable"

    https://www.dropbox.com/s/5dxow7en6mfi8 ... 7.png?dl=1

    Also didn't work.

    3. attempt:

    • This is a modification of the 2. attempt
    • I found out, that my instance variable on the "cloned" collectable on the players layer didn't work <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">
    • So I tried the same approach with a global variable
    • Since then the new (cloned) collectables at least lerp to the player position successfully and don't bounce of the grab zone anymore
    • But they still start lerping from the "wrong/old sprite's layer coordinate"

    https://www.dropbox.com/s/lgrm657d372ag ... 8.png?dl=1

    Before trying your attempt I was just wondering if you think that it will do any difference if it already doesn't work even if the sprites are on the same layer. The point is: I don't understand why to objects can't be lerped to each other when on the same layer just because there is a rotating layer underneath. Confuses me <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

    Thank you so much for all your help!

    New capx

    https://www.dropbox.com/s/4st58c0i4urcx ... 9.c3p?dl=1

    Have a great day,

    Chris

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • abj84 Sorry mate, which one would be more appropriate? I mean its not a bug, so I thought this was fitting. Will gladly move it to another topic (can i move things? Or must it be moved by moderators)

    99Instances2Go

    Dear friend! oh man where do I start. I've never expected such a precise, helpful, friendly and well written answer with so many perfect examples. I've seen many friendly replies in this forum but you are the cherry on top!

    I hope I will be able to execute your advice - but think: if Im not, I am probably just stupid

    Thanks again! Have a great day. Thank you

    Just wanna show you that I have more Construct skills then compiling unstructured commands in a colourful capx

    Best,

    Chris

  • EDIT: There is something wrong with the Z key / slowing down time feature. I haven't checked on this yet

  • Hello C'ers,

    (Im so far enjoying C3 a lot!!! Working on R34 at the moment)

    Im looking for feedback on a bug I just can't get rid of. Driving me nuts <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

    Im trying to make Sprites with a bullet behaviour

    "collectable" --> on input + overlapping players grab zone = set position of the collectable to "Lerp(Self,Player,X)" and so on.

    Everything starts to work just fine but sometimes the collectables just bounce of the grab zone. I guess it has something to to with the rotated layer underneath (?) (collectables and the whole level is rotating, player is on a different layer and not affected by the rotation).

    The pathfinder also didn't do the job <img src="{SMILIES_PATH}/icon_e_sad.gif" alt=":(" title="Sad">

    ___

    If anybody wants to have a look, those are the steps to recreate the problem:

    • press R or T to rotate the level
    • wait for yellow circles
    • keep U pressed (to collect collectables within reach)
    • now many of them bounce of strangely

    Sorry for the messy structure of the file (its the MVP/prototype/"trying out things file"). But its not big yet.

    Any help is greatly appreciated!

    Whoever just wants to have a quick glimpse at it before downloading the construct3 file:

    http://hinz-art.com/testserver/Cassini_2/index.html

    Best,

    Chris

hrisnz's avatar

hrisnz

Early Adopter

Member since 17 Feb, 2016

None one is following hrisnz yet!

Trophy Case

  • 8-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Popular Game One of your games has over 1,000 players
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

13/44
How to earn trophies