R0J0hound's Recent Forum Activity

  • It depends on what kind of water you want to achieve, and the view.

    A search for water yields some interesting results:

    Here's more of a procedural animation approach:

    https://www.scirra.com/tutorials/1124/s ... ter-plugin

    viewtopic.php?f=146&t=115321&p=826754&hilit=water+1d#p826754

    Here's for some stuff more dynamic:

    viewtopic.php?t=65530&start=0

    viewtopic.php?f=147&t=116854&p=842125&hilit=water#p842125

    Other than that you could look at effects. There is an animated warp effect that could prove useful.

    Most games appear to just have nice animations around the player in my experience.

  • Just check if the cost is less than or equal to the amount of money before buying.

    ex.

    money >= cost

  • I think we need a more precise approach. So instead we could use this equation:

    screenx = x /(z/d - cz)[/code:3lrqao82]
    cz is the z of the camera
    and d is the distance from the screen which is the same as tan(fov_angle/2).
    
    Then instead of finding the z of the back edge we'll assume it's 2 and solve for cz and d.
    The math worked out to be:
    screenx = x/((z-1)*(BottomWidth/TopWidth)+1)
    
    Actually I had a -1 in there so some reason which was throwing it off until I removed it.
    
    I updated my example in my first post.  Click to switch between the old method and the new.  The new matches the grid much better when the fov is different.
  • You mean the art?

  • This will give a signed angle diff between two angles.

    angle(0,0,cos(a-b),sin(a-b))

    It's in the range of -180 to 180. It always picks the shortest distance but it's negative if CCW and positive if CW.

    Alternatively you could leverage the CW and CCW conditions or calculate if the angle diff is CW or CCW with

    (sin(a-b)<0?-1:1)

    global sign=1

    global short_angdiff=0

    global long_angdiff=0

    every tick

    --- set sign to (sin(a-b)<0?-1:1)

    --- set short_angdiff to anglediff(a,b)*sign

    --- set long_angdiff to (360-anglediff(a,b))*-1*sign

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here's the gist of accessing objects and picked objects in python:

    Behaviors are accessed like so. If the object is called Sprite and the behavior is Platform then the behavior is SpritePlatform from python. Be aware python is case sensitive.

    To access the behavior paired with the object you do it like so depending on the way you access Sprite.

    Sprite

    SpritePlatform

    Sprite

    SpritePlatform

    SOL.Sprite

    SOL.SpritePlatform

    SOL.Sprite

    SOL.SpritePlatform

    You can also see a list of them from python by setting some text to the dictionary with a snippet like this:

    Python("str(dir())")

    Also you can look at a list of methods available in a similar way:

    Python("str(dir(SpritePlatform))")

  • You can do this in C2 expressions. Just replace rad,

    rad*180/PI

  • Why not ask here? That way if I'm not available to answer right away other experienced users can answer as well.

  • Yes, you can.

  • Do you have any particular questions on how to do something? I won't be making a tutorial, but I'd be happy to answer questions if I can.

  • It has no licience. Feel free to use it in your projects.

  • You can restrict it to a box or circle. Arbitrary shapes are quite a bit more complicated. Here's how to restrict to a circle:

    global number dist=0
    global number ang=0
    
    joystick is dragging
    --- set dist to distance(joystick_panel.x, joystick_panel.y, joystick.x, joystick.y)
    --- set ang to angle(joystick_panel.x, joystick_panel.y, joystick.x, joystick.y)
    --- joystick: set position to joystick_panel
    --- joystick: move max(75, dist) at angle ang[/code:swv2lxcq]
    Just change 75 to the max distance you want the joystick to go.
    
    To make the player move according to the joystick you likely can do it by comparing the x positions of joystick and joystick_panel, or even as a sub event of "is dragging" and use the ang variable.