Not signed in (Sign In)

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

    •  
      CommentAuthorMadball (Advanced Member)
    • CommentTimeFeb 21st 2013 edited
     
    I stumbled upon an old design ( http://forum.colorinfection.com/comm... ) and thought that this game idea has potential. I decided to remix it and make new levels. Here is a basic level:

    You can make your own levels by modifying level scenes. After I'm going to make a package of all levels.
    [edit]Modified the shape processing. Now you just need to add shapes to a shape handler.[/edit]

    In case somebody doesn't know how to make graphs, here is a quick example:

    As you know, the graph is set by coefficents of powers of X.
    Let\'s set you want to make a graph that contains points [-1,0.5], [0.6,-0.2], [1,1].
    The largest power used is (amount of points) - 1. So the graph will look like y=ax^2+bx+c.

    We know some ys and xs. Let\'s make an equation:
    a(-1)^2 + b(-1) + c = 0.5
    a(0.6)^2 + b(0.6) + c = -0.2
    a(1)^2 + b(1) + c = 1

    Then we subtract the 2nd part from the 1st and the 3rd from the 2nd:
    a(-1)^2 - a(0.6)^2 + b(-1) - b(0.6) + c - c = 0.5 - (-0.2)
    a(0.6)^2 - a(1)^2 + b(0.6) - b(1) + c - c = -0.2 - 1

    a((-1)^2 - 0.6^2) + b(-1 - 0.6) = 0.5 - (-0.2)
    a(0.6^2 - 1^2) + b(0.6 - 1) = -0.2 - 1

    a(1 - 0.36) + b(-1.6) = 0.7
    a(0.36 - 1) + b(-0.4) = -1.2

    a(0.64) + b(-1.6) = 0.7
    a(-0.64) + b(-0.4) = -1.2

    As you can see, the c is gone. Now we\'ll divide everything by the multiplier of b.

    a(0.64)/(-1.6) + b(-1.6)/(-1.6) = 0.7/(-1.6)
    a(-0.64)/(-0.4) + b(-0.4)/(-0.4) = -1.2/(-0.4)

    a(-0.4) + b = -0.4375
    a(1.6) + b = 3

    Now we subtract the 2nd part from the 1st.
    a(-0.4 - 1.6) + b - b = -0.4375 - 3
    a(-2) = -3.4375
    a = -3.4375 / (-2)
    a = 1.71875

    We found the coefficent of x^2. Now let\'s find other ones.
    Let\'s repeat the equation, but taking 1 line less.
    a(-1)^2 + b(-1) + c = 0.5
    a(0.6)^2 + b(0.6) + c = -0.2
    We removed the 3rd line, but it can be any.

    b(-1) + c = 0.5 - 1.71875(-1)^2
    b(0.6) + c = -0.2 - 1.71875(0.6)^2

    b(-1) + c = 0.5 - 1.71875
    b(0.6) + c = -0.2 - 0.61875

    b(-1) + c = -1.21875
    b(0.6) + c = -0.81875

    Again, we subtract the 2nd part from the 1st
    b(-1 - 0.6) + c - c = -1.21875 - (-0.81875)
    b(-1.6) = -0.4
    b = -0.4 / (-1.6)
    b = 0.25

    Now we have only the c left.
    a(-1)^2 + b(-1) + c = 0.5
    c = 0.5 - a(-1)^2 - b(-1)
    c = 0.5 - 1.71875(-1)^2 - 0.25(-1)
    c = 0.5 - 1.71875 + 0.25
    c = -0.96875

    Now let\'s type "1.71875x^2 + 0.25x + (-0.96875)" and check. The graph contains all the points we wanted.

    This is a long process, but you can deduce a formula that will output the coefficents from coordinates. Graphing becomes much easier.


    (For space economy, you can include all your levels in one post and just update the level counter.
    Currently 5 levels)-----------------
    LD35!
    • CommentAuthorXyuzhg (Moderator)
    • CommentTimeFeb 24th 2013
     
    Heh, very good revision of the original game!
    The only thing that bugs me is how the lower powers of x are on the upper row... We normally write top-down.

    Here are a couple of optimized solutions:

    Level 1:
    -1x + -0.1

    Level 2:
    -1x^2 + -0.2

    Level 3:
    -0.5x + -0.6

    Level 4:
    1x^2 + 0.2x

    Level 5:
    1x^9 + -1.4x^7 + 0.3x^4 + 1x + -0.4 (cool solution!)
    -----------------
    Hopefully PA is inconsistent.
    • CommentAuthorpuzzle geek (Advanced Member)
    • CommentTimeFeb 24th 2013 edited
     
    ...and I thought I was good at math... ok then.-----------------
    puzzled
    •  
      CommentAuthorTapir
    • CommentTimeFeb 26th 2013
     
    cool idea!

    Easy except the last one. Only have a good feeling on y = ax^2 + bx + c. :)-----------------
    My games: Tapir Games
    My phyards: Tapir@phyard