eli0s's Recent Forum Activity

  • Ok, I just realized that Construct doesn't like it at all if you scale the text object! It drops the fps like crazy so I guess that it could probably cause other problems too.

    I made a test capx showcasing the "zooming to the center of the window and not somewhere else" (if I may call it that) behavior. If you set the GUI layer's scale rate to 100 and try to scale the layout, the fps will fall like crazy!

    I also tried the mouse.x("layer") expression that Sargas mentions, it works as it should! I don't have the energy to further look to the layer.canvasToLayerX(x) right now and it looks more complicated.

    http://www.eli0s.com/Tests/Zooming.capx

    What would be very useful is to be able to specify the point of interest, in other words to have a variable defining the origin point upon which the transformations take place. Both with scaling and parallax scrolling. But this is an other topic https://www.scirra.com/forum/viewtopic.php?f=146&t=83989.

  • In every event that the condition is being called on every tick (like the "is overlapping" that you have).

    Also, in your photo the first event (37, or 87, I don't really make it out the image is cropped) you have a very strange condition, basically you are checking if the Player is overlapping and not overlapping Snake_Block at the same time!

    My guess is that since Construct reads events from top to bottom, the first part (is overlapping) is being replaced immediately from the second part (is not overlapping).

  • I thought that you could size up or down the text object in invert relation to the layout's scale (set layout scale to 2, text width/2 & height/2 || set layout scale to 1, text width*2 & height*2), or even scale the layer with the text object inside (set layout scale to 2, text layer scale 0.5 || set layout scale to 1, text layer scale 1) but for some reason it doesn't work, it does some weird stuff. Well, it works only if the layout size and window size are the same dimensions but that isn't very helpful. Maybe this is a bug, I don't know, I am confused with the parallaxing add scaling behavior in construct.

  • I don't think you can do it with the Fade behavior.

    Use opacity with events:

    Add an instance Boolean Variable to your object( i'll name the object "myOpaqueObject"), for example "opaque" and set the default value to true

    Add an instance Number Variable, for example "FadingTime" and set its value to something appropriate (I'll use 120).

    In the event sheet create two conditions that check and decide if the object should be opaque or not.

    For example:

    If myOpaqueObject is overlaping with "something" ===>myOpaqueObject | Set opaque to True

    If myOpaqueObject is not overlaping with "something" ===>myOpaqueObject | Set opaque to False

    Then add the events that will control the fading, depending on the booleans true/false state:

    If myOpaqueObject is opaque ===> myOpaqueObject |set opacity to self.Opacity + 1 * FadingTime * dt

    If myOpaqueObject is not opaque ===>myOpaqueObject | set opacity to self.Opacity - 1 * FadingTime * dt

    By multiplying with 120 and dt you are ensuring that the fade will last 2 seconds regardless the frame rate of the game. Use multiples of 60 for every second you wish to add (for example 60*dt will last 1 second, 120*dt will last 2 seconds, 180*dt =3 seconds and so forth...) You can effectively control the FadingTime with events (actions/instance variables/set value) to change the fading time.

  • +1

    I would love to see Spine some how integrated in to Construct.

  • You welcome!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Something like this?

    http://www.eli0s.com/Tests/Floater.capx

    You need to play around with the sine values until you find something that you like. Lot of sine behaviors with different variations will result an "organic" randomness.

  • I'm glad it worked!

  • I have noticed the same behavior just very recently. In my case I wanted after an animation finished to play a new animation mirrored. For some reason (I confirmed it in the debugger), the last tick of the last frame of the first animation was mirrored, even if the mirror was not the first action of the "on animation finished" event. This happened every time.

    My workaround is to add a 0.01 wait before the mirroring action.

    So, in your case try this:

    =>On "DropAnim" finish:

    • System wait 0.01 seconds
    • Set animation to "Falling" (play from...)
  • My guess is that you are able to zoom (change the scale of the layout) but the scaling doesn't happen at the point that you want, but rather from the center of the screen, thus offsetting your sprite and perhaps resetting your scale level..?

    That is what my experience when I was fiddling with a similar concept, only it also involved parallaxed layers that were scaling from the 0,0 coordinates and not the current scrollx, scrolly position and it was a mess!

    I just don't get how Constuct handles the 2Dish world when it comes to simple things like that. I wish there was a real camera system and world coordinates for positioning, scaling and depth perception.

    Oh well, not only I wasn't helpful but I mumbled too much

  • You're welcome!

  • Well, I won't pretend that I understand the math neither

    In your case, since you want a full circle divided into 12 frames the expression that works is the following: int(12*(1+Archer.a/360)+0.5)%12

    Here is an example, I added some movement and arrow firing functionality just for fun. What interests you are the the 2 first events.

    http://www.eli0s.com/Tests/LunatrapArcherExample.capx

    I hope that helps!

eli0s's avatar

eli0s

Member since 24 Apr, 2013

None one is following eli0s yet!

Trophy Case

  • 11-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers

Progress

13/44
How to earn trophies