Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • CreatiCode
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

CreatiCode Scratch Forum

  1. CreatiCode Forum
  2. Feedback
  3. Set rotation speed for "motion" category

Set rotation speed for "motion" category

Scheduled Pinned Locked Moved Feedback
18 Posts 3 Posters 2.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • CreatiCodeI CreatiCode

    @011830-0a42ef84

    Can you explain a bit more what’s this new block would do? Is it a speed limit on how fast the object can rotate?

    Do you think you can try to calculate how many degrees the object will rotate in total? If so, then you can calculate how long it should take based on the desired rotation speed, then you can use the following block to do the rotation:

    2f19bfad-7b2a-49e0-8b20-4fabad098cc4-image.png

    TheNicknameGovT Offline
    TheNicknameGovT Offline
    TheNicknameGov
    trusted helpers
    wrote on last edited by
    #8

    @info-creaticode Yes but I need to target a continuously moving object.

    Please help all my projects are 3000+ blocks

    Tyller_T CreatiCodeI 2 Replies Last reply
    0
    • TheNicknameGovT TheNicknameGov

      @info-creaticode Yes but I need to target a continuously moving object.

      Tyller_T Offline
      Tyller_T Offline
      Tyller_
      trusted helpers
      wrote on last edited by
      #9

      @011830-0a42ef84 are you sure you want them to turn at a limited speed? you should just have them point towards the object at all times in the context of tower defense, turn speed isn’t really something to have (especially without projectile collision stuff)

      <div component="post/signature" data-uid="255" class="post-signature">Check out my chat room project so you ppl can not use forums as chat rooms! https://play.creaticode.com/projects/66f2e1dcd1be43d82b886fbd?version=1 <p dir="auto">
      </div>

      TheNicknameGovT 1 Reply Last reply
      0
      • TheNicknameGovT TheNicknameGov

        @info-creaticode Yes but I need to target a continuously moving object.

        CreatiCodeI Offline
        CreatiCodeI Offline
        CreatiCode
        wrote on last edited by
        #10

        @011830-0a42ef84

        Can you share the project? Are you saying the target object is moving, and your sprite keeps rotating to face that target, but you don’t want your sprite to rotate too fast?

        TheNicknameGovT 1 Reply Last reply
        0
        • Tyller_T Tyller_

          @011830-0a42ef84 are you sure you want them to turn at a limited speed? you should just have them point towards the object at all times in the context of tower defense, turn speed isn’t really something to have (especially without projectile collision stuff)

          TheNicknameGovT Offline
          TheNicknameGovT Offline
          TheNicknameGov
          trusted helpers
          wrote on last edited by
          #11

          @tyller_ yes, but some units have heavier weapons like the mini gun, there-fore harder turning speed

          Please help all my projects are 3000+ blocks

          Tyller_T 1 Reply Last reply
          0
          • TheNicknameGovT TheNicknameGov

            @tyller_ yes, but some units have heavier weapons like the mini gun, there-fore harder turning speed

            Tyller_T Offline
            Tyller_T Offline
            Tyller_
            trusted helpers
            wrote on last edited by
            #12

            @011830-0a42ef84 the issue is you’ll need projectile/bullet speed first (or just detections on if a unit is pointing at an enemy so when it shoots it should actually damage an enemy)

            <div component="post/signature" data-uid="255" class="post-signature">Check out my chat room project so you ppl can not use forums as chat rooms! https://play.creaticode.com/projects/66f2e1dcd1be43d82b886fbd?version=1 <p dir="auto">
            </div>

            1 Reply Last reply
            0
            • CreatiCodeI CreatiCode

              @011830-0a42ef84

              Can you share the project? Are you saying the target object is moving, and your sprite keeps rotating to face that target, but you don’t want your sprite to rotate too fast?

              TheNicknameGovT Offline
              TheNicknameGovT Offline
              TheNicknameGov
              trusted helpers
              wrote on last edited by
              #13

              @info-creaticode https://play.creaticode.com/projects/6730fb66bf68856fe9840816

              Please help all my projects are 3000+ blocks

              CreatiCodeI 1 Reply Last reply
              0
              • TheNicknameGovT TheNicknameGov

                @info-creaticode https://play.creaticode.com/projects/6730fb66bf68856fe9840816

                CreatiCodeI Offline
                CreatiCodeI Offline
                CreatiCode
                wrote on last edited by
                #14

                @011830-0a42ef84

                Thanks. So, which sprite and which code blocks for that sprite are you trying to improve?

                TheNicknameGovT 1 Reply Last reply
                0
                • CreatiCodeI CreatiCode

                  @011830-0a42ef84

                  Thanks. So, which sprite and which code blocks for that sprite are you trying to improve?

                  TheNicknameGovT Offline
                  TheNicknameGovT Offline
                  TheNicknameGov
                  trusted helpers
                  wrote on last edited by
                  #15

                  @info-creaticode On the minigun and launcher units, their turning automatically points to the fastest enemy. I would like there to be a turning time that is slower than just automatically pointing at them.

                  I would also like to know how for units to point at the first enemy, not just the fastest one.

                  Please help all my projects are 3000+ blocks

                  CreatiCodeI 1 Reply Last reply
                  0
                  • TheNicknameGovT TheNicknameGov

                    @info-creaticode On the minigun and launcher units, their turning automatically points to the fastest enemy. I would like there to be a turning time that is slower than just automatically pointing at them.

                    I would also like to know how for units to point at the first enemy, not just the fastest one.

                    CreatiCodeI Offline
                    CreatiCodeI Offline
                    CreatiCode
                    wrote on last edited by
                    #16

                    @011830-0a42ef84

                    Can you add some instructions in the project cover page to explain how to play the game? What are the keyboard or mouse controls?

                    TheNicknameGovT 1 Reply Last reply
                    0
                    • CreatiCodeI CreatiCode

                      @011830-0a42ef84

                      Can you add some instructions in the project cover page to explain how to play the game? What are the keyboard or mouse controls?

                      TheNicknameGovT Offline
                      TheNicknameGovT Offline
                      TheNicknameGov
                      trusted helpers
                      wrote on last edited by TAO
                      #17

                      @info-creaticode The instructions are in the actual game, since that version is the test room, so it doesn’t include instructions

                      I moved the test room’s download to the actual one, you should see the instructions in that one.

                      https://play.creaticode.com/projects/672e66b5731b37123597e815

                      Please help all my projects are 3000+ blocks

                      CreatiCodeI 1 Reply Last reply
                      0
                      • TheNicknameGovT TheNicknameGov

                        @info-creaticode The instructions are in the actual game, since that version is the test room, so it doesn’t include instructions

                        I moved the test room’s download to the actual one, you should see the instructions in that one.

                        https://play.creaticode.com/projects/672e66b5731b37123597e815

                        CreatiCodeI Offline
                        CreatiCodeI Offline
                        CreatiCode
                        wrote on last edited by
                        #18

                        @011830-0a42ef84

                        This is a fun game.

                        So let’s solve one problem at a time. To limit the rotation speed, you can try to use a loop to repeatedly rotate the sprite a little bit towards the target’s direction.

                        Here is a demo project:

                        play.creaticode.com/projects/67351d4fef35162a42f8bc50

                        As you can see, in a forever loop, we take 3 steps:

                        1. calculate angle difference between current direction and the desired direction
                        2. normalize that difference to within -180 and 180
                        3. rotate for up to the speed limit

                        This is what you will get as you move the mouse:

                        speedlimit.gif

                        1 Reply Last reply
                        1

                        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                        With your input, this post could be even better 💗

                        Register Login
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • CreatiCode