Rolling BB-8 droid type Of Character
floatingwoo
Los Angeles, Calif.Member Posts: 393
Hi, I've been playing with this little character. And I was hoping to hook him up to some code that would have him move like the robot on the new star wars. The ball underneath rolls when it moves, while the head stays more or less in the top position although it would be effected by motion velocity. When it moves forward the head rotates back, while it's rolling the head comes back to center, when it comes to a stop the head would rotate forward and then come to center. I guess a google search of the the robot in action would say more than my trying to explain.
Comments
Maybe this will be of use:
http://forums.gamesalad.com/discussion/comment/490626/#Comment_490626
Cool! That's a start.Thanks
I got curious -- here is a refinement of the technique.
@RThurman Brilliant! I will share when I get the animation hooked to it. Thanks
@RThurman Hi, I got a chance to play with the demo you provided. I have a question I want the ball to rotate when it moves.
I used...
When: mo.Lin.Vel.X >= to 1 Rotate
I fear this was to simplistic. How can I get the ball to rotate the other way?...http://tinypic.com/m/ixbkf8/2
I should probably go ahead and make an idle animation with him looking at us for when he is still,and then flip the graphic when he goes the other way.
Oh wow, I've been making something that has been sort of faking that movement by using "rotate to". This might be perfect for what I'm making as well. Thanks!
Vote for Nearest Neighbor Scaling option in gamesalad! Let's make our games look truly stunning!
@floatingwoo -- To get the ball to rotate, its probably easiest to use a rotate behavior (clockwise). If you are using the demo, make the speed = game.bodyVelocity
Edit: Oh wow. I just found the animation you posted above. That really will look good. Yes, just use the rotate behavior. If the ball is about 100 pixels wide, make the speed self.Motion.Linear Velocity.X and it should work OK.
@owen_dennis -- Great! I hope it works for you.
Or - for a 100 pixel diameter circle - you could constrain the rotation to self.Position.X *-1.14591559026165
Rotate @ game.bodyVelocity/self.Motion.Linear Velocity.X would be out by a little bit (you want 314.15 x pixels per 360° degrees rather than 360 x pixels per 360° ) . . . goes to bed feeling smug about himself for adding something (probably wrong lol) to one of RThurman's pieces of maths
P.S More fantastic stuff !
@RThurman @Socks New RatBall. Still needs a little finesse but it looks pretty good thanks!
http://tinypic.com/m/ixccr9/2 wait for the blink.
Edit_ I could not do this in the latest version of game salad, the animation window goes blank and when I tried to scroll up and down in the behaviors window things started strobing out. I used 12.10 .
I guess I used the wrong trig formula. You are probably more familiar with SOHCAHTOA.
Well... I was using TLAR.
It stands for "That Looks About Right."
(I guess I should stick with standard math.)
This is brilliant! Excellent demo, sir!
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Yes, its a really nice effect! Its always stunning (for me) to see how powerful some nicely done graphics/animations can be. This is especially true for someone like me who has absolutely no graphic design skills. Even the blink brings life to the character and enhances the effect.
Perhaps this will pave the way for a few good Star Wars related games that feature a BB-8 droid.
@RThurman @Socks Hey, you have been a big help. I have another little something I would like to add to this little guy, and this may get a little tricky. I would like to add a feather or an antenna on the top that responds to the motion of the ball sort of like my little .gif here....
Edit_ Animating it may be easier. But it would be cool if it were coded. Thanks
http://www.mathwords.com/s/sohcahtoa.htm
SOHCAHTOA
A way of remembering how to compute the sine, cosine, and tangent of an angle.
SOH stands for Sine equals Opposite over Hypotenuse.
CAH stands for Cosine equals Adjacent over Hypotenuse.
TOA stands for Tangent equals Opposite over Adjacent.
Mathtap.com (Android) | Fridgemanager.com (Android) | Breakoutofspace.com (Android)
I works pretty good just eyeballing it, you wouldn't notice the very slight slip, especially on circles without markings near their edge.
I think the antenna would really be responding to the movement of his lower body as he kicks the ball ?
I've never really bothered with all that stuff, once you start introducing hypotenuses and adjacents it all starts to drift away from everyday language (and thinking), I prefer to see a moving triangle . . . hold on, demo time . . .
@Summation
Here you go (file attached) - drag the white marker on the outer circle around to any angle you want, and the length of both cosine and sine will be shown next to the vertical and horizontal lengths of the triangle.
Personally I think with this 'view' of trigonometry you can do 90% of useful trig stuff within GameSalad - the only other idea that I might add that is useful is that of isolating the sine by itself, and making the X coordinate (previously following the cosine function) a constantly increasing or decreasing value, which gives us a sine wave, which is useful for all sorts of GameSalad related fun !
The angle is quantised to 5° increments, you can switch this off in the Grabber's rules.
I've been making a game with this little type character for a while now, launching when star wars does anyways, bb8s head actually moves forwards when traveling forwards! not to the rear of bb8
@RThurman @Socks I was thinking of adding an antenna that would react to the motion, kind of like this...http://tinypic.com/m/ixci90/2
@jay2dx Lets see it!
Ok, moving on.....http://tinypic.com/m/ixcj8h/2
Looking great ! just need to stick the base of the antenna to the little guy's head !!
Thats sort of true. The droid does not need to move its head in the direction of travel. But in some scenes, it is used that way to give the prop some expressiveness. But there are other scenes where it is moving at its fastest with the head sitting straight on top. (Which is done to express flight -- run away!)
The demo originally had the ability to position the head to any angle, (which you can see in the "bobblehead" demo). But I took it out because @floatingwoo wanted it to be reactive. He wanted the whiplash effect.
Thanks! Isn't GameSalad incredibly versatile?!
Its looking good!
While adding the antenna as a seperate actor is doable. I am not sure it will have the effect you want. It would be the original "bobblehead" effect.
To get the 'body' of the antenna to be bendable would require joints. And while doable, it would eat up lots of processing power. (I had always hoped that GS would eventually incorporate box2D joints. But it has never happened.)
No, it's your processing of maths !
Well.... thanks, though I am not very good at math. But I do know how to read an equation off the internet!
Honestly, the thing that makes GameSalad great is the ease with which just about any geometry equation can be implemented. They really designed GameSalad just right. (Well, almost just right. That expression editor does need to be expandable.)
This, along with the very intuitive message that the UI implies makes GameSalad a great product for teaching (and learning) game development.*
*This message was brought to you by the GameSalad For The Greater Good Society.