Swipe-release movement

BoyGeniusStudiosBoyGeniusStudios Member Posts: 92
edited April 2013 in Working with GS (Mac)
I am working on a rocket-man styled game and I am currently working on the movement. In the game you tap the actor and swipe backwards for him to move forward (So direction=opposite direction of swipe, power=distance of swipe from actor). However I am running into a problem, but I do not know what it is and I need help fixing it.

My Setup Is:

[Movement Angle]
Rule:
When touch is pressed:
Constrain Attribute: Self.Angle to: VectorToAngle(Self.Position.X-Game.mouse.position.x, Self.Position.Y-Game.mouse.position.Y)

That statement works, but the actual movement is what is messing me up

[Movement]
Rule:
When touch is released:
Accelerate in Angle: Self.Angle

So my problem is that when I release the touch, the actor does not move. What am I doing wrong? How do I fix it?

Link to game file if you would like to see it: http://ge.tt/9KCJdWd/v/0?c

Comments

  • ozlacozlac Member Posts: 33
    if you send me the file i could have a look at it
  • BoyGeniusStudiosBoyGeniusStudios Member Posts: 92
    edited April 2013
    if you send me the file i could have a look at it
    Edit: Let me fix it, one sec

  • BoyGeniusStudiosBoyGeniusStudios Member Posts: 92
    if you send me the file i could have a look at it
    Ok here you go: http://ge.tt/8oDseSd/v/0?c
  • ozlacozlac Member Posts: 33
    i cant open that file
  • BoyGeniusStudiosBoyGeniusStudios Member Posts: 92
    i cant open that file
    Try this http://ge.tt/3YkbiSd/v/0?c
    Or are you using gamesalad for windows?
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879
    @BoyGeniusStudios -- Your file probably cant be opened because it needs to be compressed before you upload it.

    Instead of using the accelerate behavior, try using the change velocity behavior.

    When Touch is released
    --Change Velocity
    ---- Direction: vectorToAngle(Self.Position.X-Game.mouse.position.x, Self.Position.Y-Game.mouse.position.Y)
    ---- Speed: magnitude(Self.Position.X-Game.mouse.position.x, Self.Position.Y-Game.mouse.position.Y)
  • BoyGeniusStudiosBoyGeniusStudios Member Posts: 92
    edited April 2013

    When Touch is released
    --Change Velocity
    ---- Direction: vectorToAngle(Self.Position.X-Game.mouse.position.x, Self.Position.Y-Game.mouse.position.Y)
    ---- Speed: magnitude(Self.Position.X-Game.mouse.position.x, Self.Position.Y-Game.mouse.position.Y)
    I tried this, but when I release touch it doesn't move at all

    Edit:It only works if I release the touch still touching the actor, if the mouse is not touching the actor, nothing happens
  • ozlacozlac Member Posts: 33
    no im on a mac with the latest 0.10.2
  • BoyGeniusStudiosBoyGeniusStudios Member Posts: 92
    Ok I finally fixed the download by uploading it, then downloading the zip.
    So here is the zip file: http://ge.tt/9KCJdWd/v/0?c
  • BoyGeniusStudiosBoyGeniusStudios Member Posts: 92
    Nevermind, I fixed it by changing 'When touch is released' to 'when mouse button is up'
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879
    Great! Glad its working for you. Looks like the start of a fun game.
  • BoyGeniusStudiosBoyGeniusStudios Member Posts: 92
    edited April 2013
    Great! Glad its working for you. Looks like the start of a fun game.
    I have run into another problem that seems to happen to me a lot in gamesalad. I am using a scene with a width of 3,000, and the actor can fly across this. I have the control camera on the actor so the camera will follow him across the screen, but my actors movement gets screwed up when he goes past the default 480 width-line. If he is within the default box of 480px he can move sideways and vertically, but when he gets past where the scene used to end (480px line) he can no longer move vertically, he only moves horizontally. Why does it do this?

    Once again, here is the link to the updated game file if you would like to examen it yourself: http://ge.tt/8QA8EXd/v/0?c

    Edit: The end of 480px is before the third platform, so when you try to jump from the third platform he only jumps horizontally
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879
    The file can't be downloaded. But I am sure it is because you are not taking the camera's origin into account. You will need to unlock the actor (to get to the camera's origin) and use the following expressions in the appropriate places.

    vectorToAngle( self.Position.X - game.Mouse.Position.X - scene.Camera.Origin.X , self.Position.Y - game.Mouse.Position.Y - scene.Camera.Origin.Y )

    magnitude( self.Position.X - game.Mouse.Position.X - scene.Camera.Origin.X , self.Position.Y - game.Mouse.Position.Y - scene.Camera.Origin.Y )
  • ElfizmElfizm Member Posts: 489
    Just be careful, when people ask for projects, give them a separate one then your game. No art and only the feature your having trouble with. Just thought I should mention it because some people won't hesitate to download and use and release as thier own. It's common sense but I see it every now and then :)
  • BoyGeniusStudiosBoyGeniusStudios Member Posts: 92
    Snip
    It worked, thank you very much. You have been VERY helpful, and this is why I love the gamesalad community!
    Snip
    Yes, I made sure to do that. The one I uploaded only has basic characters without pictures, so nobody would be able to steal them.
Sign In or Register to comment.