Discuss Scratch

DudePotato3
Scratcher
63 posts

Sprite rotation out of sync

Ive been working n this little project, but whenever i turn counterclockwise, the spearhead lags behind. Please help!

(Note wait for the intro, then press space. click left and right arrow keys to turn.)

https://scratch.mit.edu/projects/170057038/

Me: Be a dude and play these!
Guy: WHAT YA GOIN ON ABOUT MATE
Me: Look down there! Game links!
Guy: oh


Space Shooter (2 Player Game) // Defend The Castle // Diamond Clicker
Uniquename1
Scratcher
100+ posts

Sprite rotation out of sync

Stamps don't surf… move stamps don't move.

You could just have multiple costumes of the spear and switch to bigger and bigger ones as it grows. Seems the easiest solution.

Try my games.
Scratch Sprite Club VI Soccer
Star Fighter Shooting
Space Marines: Boarding Party Strategy
Lion Runner Running/ Platformer
DudePotato3
Scratcher
63 posts

Sprite rotation out of sync

Uniquename1 wrote:

Stamps don't surf… move stamps don't move.

You could just have multiple costumes of the spear and switch to bigger and bigger ones as it grows. Seems the easiest solution.


what im talking about is not the stamp, just the head of the spear when its not extended.

Me: Be a dude and play these!
Guy: WHAT YA GOIN ON ABOUT MATE
Me: Look down there! Game links!
Guy: oh


Space Shooter (2 Player Game) // Defend The Castle // Diamond Clicker
footsocktoe
Scratcher
1000+ posts

Sprite rotation out of sync

DudePotato3 wrote:

Ive been working n this little project, but whenever i turn counterclockwise, the spearhead lags behind. Please help!

(Note wait for the intro, then press space. click left and right arrow keys to turn.)

https://scratch.mit.edu/projects/170057038/

It's because the spear cannot point in the circle's direction until after the circle points in the circle's direction. Change turn 7 degrees to turn 1 degree and you will see it. Or put a wait block in to see it.


SHOOT THE SPACE MONSTERS! ….. A game everyone can play! Bright colors, bonky sounds!
THE 12 BALLS OF CRAZY AL ……. New scrolling adventure game!

DudePotato3
Scratcher
63 posts

Sprite rotation out of sync

footsocktoe wrote:

DudePotato3 wrote:

Ive been working n this little project, but whenever i turn counterclockwise, the spearhead lags behind. Please help!

(Note wait for the intro, then press space. click left and right arrow keys to turn.)

https://scratch.mit.edu/projects/170057038/

It's because the spear cannot point in the circle's direction until after the circle points in the circle's direction. Change turn 7 degrees to turn 1 degree and you will see it. Or put a wait block in to see it.

Then why does it turn clockwise properly? How can i go about fixing this?

Me: Be a dude and play these!
Guy: WHAT YA GOIN ON ABOUT MATE
Me: Look down there! Game links!
Guy: oh


Space Shooter (2 Player Game) // Defend The Castle // Diamond Clicker
footsocktoe
Scratcher
1000+ posts

Sprite rotation out of sync

DudePotato3 wrote:

footsocktoe wrote:

DudePotato3 wrote:

Ive been working n this little project, but whenever i turn counterclockwise, the spearhead lags behind. Please help!

(Note wait for the intro, then press space. click left and right arrow keys to turn.)

https://scratch.mit.edu/projects/170057038/

It's because the spear cannot point in the circle's direction until after the circle points in the circle's direction. Change turn 7 degrees to turn 1 degree and you will see it. Or put a wait block in to see it.

Then why does it turn clockwise properly? How can i go about fixing this?

Actually, when I tried it, it was clockwise that didn't turn properly and counterclockwise that did. What that suggests is that it is a problem with initializing your variables. If necessary, just have one green flag, initialize variables, then start the project with a start message.


SHOOT THE SPACE MONSTERS! ….. A game everyone can play! Bright colors, bonky sounds!
THE 12 BALLS OF CRAZY AL ……. New scrolling adventure game!

DudePotato3
Scratcher
63 posts

Sprite rotation out of sync

footsocktoe wrote:

DudePotato3 wrote:

footsocktoe wrote:

DudePotato3 wrote:

Ive been working n this little project, but whenever i turn counterclockwise, the spearhead lags behind. Please help!

(Note wait for the intro, then press space. click left and right arrow keys to turn.)

https://scratch.mit.edu/projects/170057038/

It's because the spear cannot point in the circle's direction until after the circle points in the circle's direction. Change turn 7 degrees to turn 1 degree and you will see it. Or put a wait block in to see it.

Then why does it turn clockwise properly? How can i go about fixing this?

Actually, when I tried it, it was clockwise that didn't turn properly and counterclockwise that did. What that suggests is that it is a problem with initializing your variables. If necessary, just have one green flag, initialize variables, then start the project with a start message.

Im sorry, what is “initializing variables?”

Me: Be a dude and play these!
Guy: WHAT YA GOIN ON ABOUT MATE
Me: Look down there! Game links!
Guy: oh


Space Shooter (2 Player Game) // Defend The Castle // Diamond Clicker
footsocktoe
Scratcher
1000+ posts

Sprite rotation out of sync

DudePotato3 wrote:

Im sorry, what is “initializing variables?”

Uh oh, now I am almost positive that is your problem.

All variables have to be set to a value before the program starts. It's called initializing the variables. Not doing it can cause all kinds of weird problems, or in some cases, no problems at all.

It's easy to do…
when green flag clicked
set [every variable v] to [its correct starting value]


SHOOT THE SPACE MONSTERS! ….. A game everyone can play! Bright colors, bonky sounds!
THE 12 BALLS OF CRAZY AL ……. New scrolling adventure game!

Scratch-Minion
Scratcher
1000+ posts

Sprite rotation out of sync

Is there any reason you can't add the spear to the circle frame costume!

Less code and no timing issues.
DudePotato3
Scratcher
63 posts

Sprite rotation out of sync

footsocktoe wrote:

DudePotato3 wrote:

Im sorry, what is “initializing variables?”

Uh oh, now I am almost positive that is your problem.

All variables have to be set to a value before the program starts. It's called initializing the variables. Not doing it can cause all kinds of weird problems, or in some cases, no problems at all.

It's easy to do…
when green flag clicked
set [every variable v] to [its correct starting value]

Thanks! ill try it!

Edit: i did initialize all variables on the backdrop now…. still lags behind

Last edited by DudePotato3 (Aug. 6, 2017 16:53:07)


Me: Be a dude and play these!
Guy: WHAT YA GOIN ON ABOUT MATE
Me: Look down there! Game links!
Guy: oh


Space Shooter (2 Player Game) // Defend The Castle // Diamond Clicker
Destroyer1727
Scratcher
500+ posts

Sprite rotation out of sync

its because it doesnt turn when you have the doing variable set to 1 you need to remove that and it will be fixed

Last edited by Destroyer1727 (Aug. 8, 2017 17:44:11)


Old Signature wrote:

I am the proud owner of Destroyer's Script Shop
Please check out my account, Destroyer1727 and look at all my super fun games!
I love to help new scratchers so also check out my studio and project that are meant for just that!
I am also part of the VIS Collaboration! Please join it.
I am the owner of Coaches of Code with LilyPuplover.
I am the 18775968th user on scratch.
I used to work at Scratch Request Shop!

Destroyer1727
Scratcher
500+ posts

Sprite rotation out of sync

Destroyer1727 wrote:

its because it doesnt turn when you have the doing variable set to 1 you need to remove that and it will be fixed
and keep track of the amount of stamps it has done and delete them after you turn then remake the the amount of stamps

Old Signature wrote:

I am the proud owner of Destroyer's Script Shop
Please check out my account, Destroyer1727 and look at all my super fun games!
I love to help new scratchers so also check out my studio and project that are meant for just that!
I am also part of the VIS Collaboration! Please join it.
I am the owner of Coaches of Code with LilyPuplover.
I am the 18775968th user on scratch.
I used to work at Scratch Request Shop!

Destroyer1727
Scratcher
500+ posts

Sprite rotation out of sync

Destroyer1727 wrote:

Destroyer1727 wrote:

its because it doesnt turn when you have the doing variable set to 1 you need to remove that and it will be fixed
and keep track of the amount of stamps it has done and delete them after you turn then remake the the amount of stamps
comment my profile for more help

Old Signature wrote:

I am the proud owner of Destroyer's Script Shop
Please check out my account, Destroyer1727 and look at all my super fun games!
I love to help new scratchers so also check out my studio and project that are meant for just that!
I am also part of the VIS Collaboration! Please join it.
I am the owner of Coaches of Code with LilyPuplover.
I am the 18775968th user on scratch.
I used to work at Scratch Request Shop!

Powered by DjangoBB