Control actor by mouse, but...

RohalRohal GermanyMember Posts: 62

Hi,

i like to build a control mechanism similar to drag&drop but with a little difference.
If the player moves the mouse/swipes to the right - the actor should move about 4 x px right.
The idea is, that the control area for the movement is smaller than the screen.

Does this make any sense to you? ;-)

See'ya
Rohal

Comments

  • Aero_SwagAero_Swag Member Posts: 14

    Is the game similar to one of those shifting puzzle games?

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880

    @Rohal‌

    Make two attribute, "oldX" and "difference" and then create the following logic:

    When touch is pressed
      Change Attribute: self.oldX To: mouse.X
      Constrain Attribute: self.difference To: mouse.X -self.oldX
      When self.difference > 4
        Change Attribute: self.Position.X To: self.Position.X + 4
        Chane Attribute: self.oldX To: mouse.X
    
Sign In or Register to comment.