Close to giving up :-(

froamerfroamer Member Posts: 29
edited November -1 in Working with GS (Mac)
I have been playing with GS for some months now, I've helped others on the forum (within my abilities) and I am a web software developer. I have a great game concept, I developed some proof of concepts and I've paid for artwork.

But I can't for the life of me get the basic physics of my game to work. So I turn to you GS experts in hope you can help.

Concept:
A ball bounces vertically constantly. You drag the background horizontally to scroll it and the ball moves horizontally with the background. Platforms, obstacles, etc. scroll with the background and you control where the ball will bounce to navigate through the game.

I have tried two techniques:

1) Move the camera and constrain the ball in the x-axis
2) Drag the ball and make it control the camera.

In both approaches everything is fine until the ball reaches a virtual wall. I want the scrolling to stop taking effect but the ball to carry on bouncing vertically.

What actually happens is the ball goes all over the place as it seems to overlap with the wall. I have tried only constraining the x-axis of the ball only when it is not colliding, but if you keep scrolling the ball "pushes" through the wall. All this tends to disrupt the vertical bounce.

This is what I currently have:

Scene
....Size
........Width: 4800
........Height: 320

Background (instance) 4800x320
....Rule:
........When Actor receives event touch is pressed
............Change Attribute: game.Dragging = true
........Otherwise
............Change Attribute: game.Dragging = false
....Rule:
........When Attribute game.Dragging = true
............Change attribute game.BallOrigin = scene.Background.Ball.Position.X
............Change attribute game.DragOrigin = game.Mouse.Position.X

Ball (Prototype)
....Collide with actor with tag "bouncy"
....Control Camera
....Rule:
........When actor receives event "overlaps or collides" with actor with tag "bouncy"
............(do nothing)
........Otherwise
............Rule:
................When attribute game.Dragging = true
....................Constrain attribute self.Position.X = ( game.DragOrigin - game.Mouse.Position.X )- game.BallOrigin

There are various walls tagged as "bouncy".

I know it is a lot to ask, but if anyone can help or give me some pointers I would very much appreciate it.

Comments

  • ORBZORBZ Member Posts: 1,304
    Interesting idea, I'm not sure I clearly understand the problem. Have you tried manual bouncing instead of physics?

    Not sure if that will suit your design goals or not.

    I'd be happy to take a look at it for you if you like.

    Email soul@orbz.com
  • ORBZORBZ Member Posts: 1,304
    Oh this just came to me, try constraining to x velocity to 0. And the x position to the touch.x position. Let y flow freely with physics on.
  • ValanValan Member, BASIC Posts: 410
    It is a great concept. Don't give up.

    I don't have a sure fire answer but I think in general you may need multiple ball actors and swap them for different puzzles or even areas of puzzles. Use foreground objects to cover the swapping.
  • Rob2Rob2 Member Posts: 2,402
    perhaps you could post a cut down or stripped project that just shows the problem you want to solve
  • peachpellenpeachpellen Member Posts: 977
    Don't give up - I've had times like that too. Trust me, when you get it working it will be a total joygasm.

    I'm sure someone here will be able to help you; we have SO many wonderful community members :)

    Hang in there!

    Peach
  • froamerfroamer Member Posts: 29
    Well guys, I'm back on track - thanks for your positive comments and suggestions, I was in a bit of a GS low.

    ORBZ above offered to take a look at my project and fixed it - a true star!!!!!

    We are now collaborating. I am a singer song writer so I am going to write his game music, he is going to help me with GS when I get stuck (hopefully not too often now).

    Thanks again everyone, your right peachpellen, it's a great community :-)
  • quantumsheepquantumsheep Member Posts: 8,188
    froamer said:

    ORBZ above offered to take a look at my project and fixed it - a true star!!!!!

    The guy's a star! :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

Sign In or Register to comment.