GameSalad

Dragging actor

CraigMackCraigMack Posts: 27Member

Hi guys.

Ive been stuck on this for a while now, my games nearly complete but there is just one thing stopping me from releasing.

I use to have an actor with a move rule using keyboard buttons to move across a line, but now from feedback from some people testing the game preferred it to have a drag feature. i created one before using the constrain atribute tool, moving the x axis (max((80+( self.Size.Width /2)),min((400-( self.Size.Width /2)), game.Mouse.Position.X ))

this didnt really work, i want a drag feature where im able to drag the actor across a diagonal line (across one side of a hexagon and back)

Am i able to do this?

Answers

  • CraigMackCraigMack Posts: 27Member

    Bump

  • Look+Creative%2C+L.L.CLook Creative, L.L.C Posts: 5Member, PRO

    Probably necro posting here but assuming you still need help with this, this would keep the actor constrained to an edge of a hexagon.

    Constrain Attribute (self.Position.X) to (game.Mouse.Position.X)

    Rule: When All
    Touch is Pressed
    (self.Position.X) > 0
    (self.Position.X) < (game.halfHexagonWidth)

    Then
    Constrain Attribute (self.Position.Y) to (tan(angle)*(self.Position.X))

Sign In or Register to comment.