How do I chnage sprite for an 8 angle movement?

0 favourites
  • 7 posts
From the Asset Store
3D Car Pack 1
$2.99 USD
3D models + Rendered Low-Poly Cars in isometric, top-down, and side angles.
  • I have 8 sprites which have different degrees of rotation. I want to be able to set it up so when the object moves it will change the sprite. So if I tell it to move top right it will show the 45 degree sprite and so on. For an example I want the moveable object to act like units in Red Alert or simular RTS games.

    Forgive me, I have only just started using the program and have also looked through examples but can't figure it out.

  • Put your graphics all in one sprite with each graphic having a different frame and named animation.

    Then you can use set animation in the events.

  • set animation frame to abs(self.8waymovement.angleofmovement/45)? does that work?

    and the speed of movement or rotation needs to be set to 45 degrees interval or 360 degrees rotation, never 90 degrees interval unless you divide the angle by 90 and show only 4 frames. cause 360/45 = 8 , and you need the rotation to happen on 360 degrees to show all the frames.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks guys. I tried most of what you said, but I kind of stumbled upon the fact that if I set the frame to the angle the sprite is facing and then stop all animations in events and then set the frame to the one matching the sprite in the layer, the 8 direction behavior takes over and it works like a charm. I can't believe how well this engine works, it truly does help the non programmer make games. I can upload an example file if anyone wants to check it out for what I wanted?

  • I was mistaken and what I said is not the fact. It just looked like it because I overlooked the fact my sprite is a top down view.

    abs(self.8waymovement.angleofmovement/45) just gives me errors and wont let me click done.

    I have added my sprite and given it the frames, but I have no idea as of yet how to make the animations. I can only add new frames to the sprite.

  • I was mistaken and what I said is not the fact. It just looked like it because I overlooked the fact my sprite is a top down view.

    abs(self.8waymovement.angleofmovement/45) just gives me errors and wont let me click done.

    I have added my sprite and given it the frames, but I have no idea as of yet how to make the animations. I can only add new frames to the sprite.

    In the editor you create your sprite. In the add frames box you can duplicate frames in the animations frames box. Right click to add blank frames, copy or duplicate. In the Animations box you see little rolls of film and you need to name those.

    Click on one of your named film strips and the properties box will open and you can set the speed of the animations and set it to loop or not.

  • Ok, so I have the animations named (for now they are just single frames of different angles) and I have set up events and actions in which I think should work, but I am not getting the results I wanted. I'm not quite sure if what I have it right etc.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)