Discuss Scratch

JamesOuO
Scratcher
500+ posts

(ADVANCED) Separate limb movement with rotation- HELP NEEDED

I'm currently making a happy-wheels styled game, (minus blood) the wheels of the bike are separate sprites and move to the base of the bike using
forever
go to x x position of (Bikebase) + 26 y y position of (Bikebase) - 9
But I can't figure out how to make it so when the bike base rotates, the wheel moves to the correct position. Can anyone help?

Last edited by JamesOuO (Nov. 10, 2013 00:07:54)


derniersamourai
Scratcher
100+ posts

(ADVANCED) Separate limb movement with rotation- HELP NEEDED

You'll have to use “sin” and “cos”
or just use Alice (see wikipedia “programming” “alice”)
… just joking ;-)
JamesOuO
Scratcher
500+ posts

(ADVANCED) Separate limb movement with rotation- HELP NEEDED

derniersamourai wrote:

You'll have to use “sin” and “cos”
or just use Alice (see wikipedia “programming” “alice”)
… just joking ;-)
How do those work? :S

turkey3_test
Scratcher
1000+ posts

(ADVANCED) Separate limb movement with rotation- HELP NEEDED

JamesOuO wrote:

derniersamourai wrote:

You'll have to use “sin” and “cos”
or just use Alice (see wikipedia “programming” “alice”)
… just joking ;-)
How do those work? :S
They are part of trigonometry, advanced mathematics. If you want to learn a little of it, read Trigonometry. Maybe to make it easier, you can make the wheels part of the bike? Just have multiple costumes for the wheels rotations.

scubajerry
Scratcher
1000+ posts

(ADVANCED) Separate limb movement with rotation- HELP NEEDED

look at the front wheel
http://scratch.mit.edu/projects/13626881/

And look at the blue dot on the ball
http://scratch.mit.edu/projects/13636819/

Last edited by scubajerry (Nov. 10, 2013 18:03:25)

JamesOuO
Scratcher
500+ posts

(ADVANCED) Separate limb movement with rotation- HELP NEEDED

turkey3_test wrote:

JamesOuO wrote:

derniersamourai wrote:

You'll have to use “sin” and “cos”
or just use Alice (see wikipedia “programming” “alice”)
… just joking ;-)
How do those work? :S
They are part of trigonometry, advanced mathematics. If you want to learn a little of it, read Trigonometry. Maybe to make it easier, you can make the wheels part of the bike? Just have multiple costumes for the wheels rotations.
I'm trying to make the game as realistic as possible and that would lower the quality.
Edit——
I'm making the game all-terrain; what the point is is that you can create your own course and remix, like happy wheels. I'm making a realistic engine so that you can only accelerate with back wheel touching, brakes work better with both wheels on ground, etc.

Last edited by JamesOuO (Nov. 10, 2013 18:39:33)


JamesOuO
Scratcher
500+ posts

(ADVANCED) Separate limb movement with rotation- HELP NEEDED

I got the x position to work perfectly with (sin * 26), but with the y (cos * -9) doesn't work properly?

scubajerry
Scratcher
1000+ posts

(ADVANCED) Separate limb movement with rotation- HELP NEEDED

The constant (26 or -9) is how far from the pivot point the object is. It should be the same for both SIN and COS. look at the projects I posted for examples.
JamesOuO
Scratcher
500+ posts

(ADVANCED) Separate limb movement with rotation- HELP NEEDED

I was testing around, almost got it, but i shared it so you guys can help. If you fix it, remix, I'll put it in my backpack and you can unshare it.
BTW, the “right” wheel is the right wheel.

JamesOuO
Scratcher
500+ posts

(ADVANCED) Separate limb movement with rotation- HELP NEEDED

scubajerry
Scratcher
1000+ posts

(ADVANCED) Separate limb movement with rotation- HELP NEEDED

JamesOuO wrote:

Oops! don't feel like editing and I forgot the link!
There you go. http://scratch.mit.edu/projects/14129014/

I did the code, but the costumes need to be PERFECTLY centered. I did that too.

Last edited by scubajerry (Nov. 10, 2013 21:38:20)

JamesOuO
Scratcher
500+ posts

(ADVANCED) Separate limb movement with rotation- HELP NEEDED

scubajerry wrote:

JamesOuO wrote:

Oops! don't feel like editing and I forgot the link!
There you go. http://scratch.mit.edu/projects/14129014/

I did the code, but the costumes need to be PERFECTLY centered. I did that too.
Ok, got both wheels, fixed costumes along with making them look better xD, made basic gravity, ground detection, wall detection, slope detection, now all I need is a starting level and I'm done!

Powered by DjangoBB