R0J0hound's Forum Posts

  • In the editor you can hold down shift when dragging resize handles to scale proportionally.

    In events you can use the set scale action to set the scale proportionally to the original size. 1 ortiginal, 0.5 haf, 2 double.

  • Here's the formula for calculating the proportional height from the width.

    height = width* OriginalHeight/OriginalWidth

  • [quote:tdau5iyz]canvas doesnt have abillity to use blending effects

    Not true.

    You can use the canvas or paster plugins to do the effect you want. The way you erase is by using the "paste object" action with another sprite that has the "destination-out" blend.

  • From the first post or any of the parameters that set color.

    [quote:hcyyq67r]"hsl(120, 50%, 50%)"

    The first value is from 0 to 360. The other values are from 0 to 100, be sure the % symbol is there. All values have to be whole numbers, so no decimals.

  • It's working correctly, it gives the angle in the range from -180 to 180 because of the math behind it.

    If you want it in the range of 0 to 360 then you can convert it with (a+360)%360.

    I don't have the second issue. Are you putting the coordinates in the correct order? It finds the angle from point 1 to point 2.

  • Here's a different way to do tetris, without any fancy math.

    https://dl.dropboxusercontent.com/u/542 ... ris02.capx

  • It's probably unlikely that we'll be on at the same time. But ask anyway, I don't mind long explanations.

  • Looks fun.

  • You can't create new private variables in python. You can create more python variables and add them to objects but unfortunately Sprite[0] is a Different python object than SOL,Sprite[0] so that can lead to errors.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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

  • 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))")