Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / mouse joint

Author
Message
chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 8th Sep 2011 21:07
does anyone have an idea how to move a box with mouse using box2d ive tried the mousejoint but i cant seem to get it to work.

chunks

nvidia geforce 9500gt + amd athlon 64
windows vista ultimate.
Conjured Entertainment
AGK Developer
18
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 8th Sep 2011 21:16
I'm not sure about box 2d (what is that?), but here is how I move a sprite with the mouse in AGK...

SetSpritePosition(spriteID, GetPointerX(), GetPointerY())

chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 8th Sep 2011 21:23
box2d is the physics part of agk , i`ve been trying to use the mousejoint and mousejoint target commands , i`ve managed to get a physics sprite to move around with mouse i now need to make it disconnect from the joint and carry on being affected with physics , i think the joint would have to be deleted .

gonna try it now thanks anyways.

chunks

nvidia geforce 9500gt + amd athlon 64
windows vista ultimate.
Conjured Entertainment
AGK Developer
18
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 8th Sep 2011 21:28 Edited at: 8th Sep 2011 21:35
Oh, the physics section of the docs.
I have not tried playing with the joints yets.
Interesting reading though.
I might play with this tomorrow and see what I can come up with.

Yeah, just from reading the docs for a few minutes, I think you are right.
Deleting the mousejoint should do the trick.

Thanks and good luck

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 9th Sep 2011 11:41
We need a good tutorial on Box2d.
Do you know if there is anything generic that explores all the various commands with examples?
chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 9th Sep 2011 14:41
@bjadams the box2d examples and docs are c++ and they are a far cry from how they are used in agk , in agk all the difficulty and setup are wrapped away .

What you can do is download the latest box2d from http://box2d.org/ , and compile the testbed there are many examples of how things work but as i said the commands are c++ and more difficult.

chunks

nvidia geforce 9500gt + amd athlon 64
windows vista ultimate.

Login to post a reply

Server time is: 2024-03-29 06:14:24
Your offset time is: 2024-03-29 06:14:24