How can I do this?

Non-platform specific questions.

How can I do this?

Postby raminkhan » Mon Dec 26, 2011 6:16 am

okay its a piece of wood hanged by two ropes. I want to make it so that like angry birds how the user can stretch the rubber as much as you want, so here I want to let the user to stretch the wood back as hard as they can and then let go. How?

Please see the picture for better understanding.
Attachments
ForGEForum2.png
ForGEForum1.png
raminkhan
 
Posts: 63
Joined: Mon Sep 12, 2011 3:35 pm
Score: 0 Give a positive score

Re: How can I do this?

Postby skydereign » Mon Dec 26, 2011 6:26 am

First two things that came to mind. It isn't especially easy to do, assuming you want to make it realistic. You can do the slingshot mechanics by having a resting point, and using its initial position and a mouse button down event to determine the position (xmouse, ymouse) but the actual string actors will have to be drawn with canvas. So for the slingshot clicking the actor will trigger a variable so that it can use the xmouse ymouse to position the actor, and when it is in position you update the strings. You can limit the length you can pull the platform back with by using some simple trig (cos/sin of a circle). This method won't rotate the wood though, so you'll have to do animation rotation as well as some physics calculations to make a convincing rotation effect though.

If you want to use gE 1.5's physics, then you would use three distance joints, break the wood into two parts, and have them connected by one of the distance joints, and then the strings connecting to the different pieces. I don't believe distance joints are elastic though, so it would be limited to just a swing unless you use some trig on the dots to which it connects.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: How can I do this?

Postby raminkhan » Mon Dec 26, 2011 6:45 am

so sorry to extremely bothering you My dear sky and I dont mean to be lazy but I just completed physics 1 in CUDenver, and I dont have a flipping clue how to apply spring elastic formula and newtons in GE so is there anyway you could do a simple demonstration I dont want to make you to do it all but a simple start up to get me going. THanks my dear help friend.


NOT YELLING :D BUT I DONT KNOW HOW TO THANK YOU SKY YOUR REALLY BEEN SO HELP FULL TO ME THANKS BUD.
raminkhan
 
Posts: 63
Joined: Mon Sep 12, 2011 3:35 pm
Score: 0 Give a positive score

Re: How can I do this?

Postby skydereign » Mon Dec 26, 2011 9:47 am

Well, here is the start you were asking for. This should be enough to get you going on a convincing enough effect. It is a little harder since you have two strings to calculate, but you can ignore that as you should be able to get a generally accurate directional_velocity without actually doing any physics type stuff (angry birds didn't use real slingshot physics either).
Attachments
swing.zip
(4.27 KiB) Downloaded 132 times
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: How can I do this?

Postby 247wkman » Thu Oct 24, 2013 3:09 am

i remember the magnet game (the colorful one that picked stuff up of the conveyor belt in the video ad) that used rings sprites locked together by ball sprites- it used no code, just the auto-physics. it fell under gravity and swang (though it could have used more links for a more fluid motion and had little counter swing) when dragged- the ring sprites were set invisable and canvas used to draw the rope. doing an adapted version might work with this ged.
247wkman
 
Posts: 67
Joined: Mon Dec 13, 2010 3:55 pm
Score: 3 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron