Very basic slingshot type example

lildragnlildragn Member Posts: 105
edited November -1 in Working with GS (Mac)
Hi guys, I usually find the best way to learn a new software is to get right in there with a project, you learn so much more that way. Problem is right now, most of the templates/examples I've been trying are proving to be a bit challenging and a moral sinker since alot of them aren't commented and I have no idea what does what and why. I mean there's reverse engineering, but even that can be daunting.

My plan is to create a Hit the apple type game http://www.newestgames.us/view/271/Hit-the-Apple.htm and I've found ToastKitten's slingshot template, but there's alot of fluff in there and no commented text to say what's happening... as a new user it makes learning tough.

With all that said, would anyone be kind enough to help break it down? There's quite a bit of Math involved and in order to change things I need to actually understand what's happening.

Anyhoo sorry for the long winded post, if anyone can assist that would be awesome.

~t

Comments

  • lildragnlildragn Member Posts: 105
    Although I don't need to change this, the 'Constrain distance from center' math as I understand it is, you finding the square root of the X/Y axis and applying that to the center dot? Or just the center of the mouse click?

    sqrt(( game.Mouse.Position.X - self.centerX )*( game.Mouse.Position.X - self.centerX )+( game.Mouse.Position.Y - self.centerY )*( game.Mouse.Position.Y - self.centerY ))

    I also removed the randomizer, timer and the additional ball stuff from the startup... haven't broken anything yet :)

    Also I would like to limit the Degree of freedom, since it'll be a bow like in the link above.

    Finally, I want the ball to collide with actors (say the enemy character) but I don't want it to bounce. How do I make it "stick" to the last place it hit?

    It's alot to ask I know, but I'm taking it in steps here :)

    thx!

    ~t
Sign In or Register to comment.