Making a bat

daniel.robert.campbelldaniel.robert.campbell Member Posts: 251
edited November -1 in Working with GS (Mac)
I'm having some trouble making a "bat" in my game. I have a ball, and I want the player to be able to swing a bat at it. But I am having trouble getting the bat to react the way I want it to. Details of what I WANT the bat to do are below. Any advice you could give would be awesome. Thanks!

Basically the bat sits horizontally when idle. I want the player to push a button or key and that will cause the bat to draw back to a vertical angle. The rotation pivot should be on the handle (which I don't know how to do). After releasing the button the bat should swing forward at a greater speed than it drew back. It would also be nice if the bat swung through. Meaning that it swings past the perfectly horizontal mark by a few degrees before moving back to the idle position.

Again, any guidance people could give me would be greatly appreciated. /hug.

Comments

  • quantumsheepquantumsheep Member Posts: 8,188
    Take one rat.

    Add wings.

    Tada!

    On a perhaps more helpful note, a good starting point may be the pinball template which you can find on this site.

    The 'flippers' would behave in a reasonably similar way.

    If that doesn't help, then I'm sure some math whiz will come along and lend a hand!

    Good luck!

    QS :D
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    in the shared projects their is a demo called "chainsaw demo" that, despite the name, should help with the rotation.

    or make an actor twice as long as the bat and in photoshop make an image that is half bat half clear. The just use the rotate to position or angle behavior.
  • JCFordJCFord Member Posts: 785
    Here you go, sorry couldn't resist!

    image
  • chosenonestudioschosenonestudios Member Posts: 1,714
    image

    Hah
  • ChaserChaser Member Posts: 1,453
    Check out the pnball demo as well for the paddles
  • Thanks for the help everyone. Much appreciated. /hug
  • I feel really stupid asking this but...does anyone know where I can find the self.start expression? I am looking under the actor's options and I cannot find anything that leads to a self.start result.
  • JackBQuickJackBQuick Member Posts: 524
    "Self" would refer to the actor you are looking at and "start" is a user-defined attribute. See:

    Better understanding at Attributes??
  • Thanks for the help everyone. I'm very happy with how supportive the community is so far. I really do appreciate it.
Sign In or Register to comment.