gravity control

Apprentice
Posts: 8
Joined: 2009.06
Post: #1
Hi I am using chipmunk for a gravity based game.

My question. I do not want the object to be dropped/released until the player determines where it will drop. Currently with my code, the ball drops immediately without players choice of dropping position. Not good.

Can anyone give me code, hints clues.

thanks
Quote this message in a reply
Apprentice
Posts: 8
Joined: 2009.06
Post: #2
essentially I want the ball, to be held at the top until the player chooses to let it release. ANy clues would be greatly appreciated.


Something,
onLoad
ball remain in Y position (top of screen) then wehn tapped, ball drops, using gravity as its drive. I suppose, now that I think about it, I could not use gravity, and just use someting would simply fire it.



:?
thoughts?
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #3
You could create a joint to hold it in place, and remove the joint to let go. Even simpler is to not add the body or collision shape to the space until you want it to fall, but then it won't interact with other objects while it sits there.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Apprentice
Posts: 8
Joined: 2009.06
Post: #4
Skorche Wrote:You could create a joint to hold it in place, and remove the joint to let go. Even simpler is to not add the body or collision shape to the space until you want it to fall, but then it won't interact with other objects while it sits there.

so in theory tho, the ball will be held by a "hero",so that "hero"object, with slide controls could be "the joint"/ and object which will, when triggered also be the delegate to get the ball and release it?

Or should the hero object hold the ball inside it?


Minimal memory either way I imagine. But I think the Ball should be a separate class seeing as it has to have full gravity and physics applied to it.

Thanks!

Of course if I am way off or if you have thoughts please drop em.

:]cheers
ren
Quote this message in a reply
Apprentice
Posts: 8
Joined: 2009.06
Post: #5
hey i replied to this on my other computer, got an idea, wrote but its not here (on new computer) if for reason it is lost...


I am saying, for now...
Re: a joint as a holder...
Can joints be moved by the controller (shifted left right?) or are joints part of objects ... should be able to move it eh?


Also
My ealier thoughts,
if lost. ]
should ball be called by delegate from joint object?
I think so right?

anyhow thanks again,
ren

ps.
please feel free to ad thoughts if you have them.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  giving gravity and weight to object 9livesoftware 2 2,999 Aug 23, 2009 01:46 AM
Last Post: mikey
  Adding static gravity object game_ding 4 4,749 Mar 28, 2008 05:25 PM
Last Post: Skorche