How to Make an actor like this

Sunny

  • Posts: 53
Hey, how do i make an actor behave like the spaceship in this game:

https://www.youtube.com/watch?v=KXrpp774ADU

Say I use keyboard left and right keys to turn the actor left and right

Thanks,
Sunny

Sunny

  • Posts: 53
Also, how would i go about making a sort of endless scene? With the actor free to move top, down, left or right?

Any help would be appreciated!

t4u

  • Posts: 418
How movement should work:
The speed of ship(black - total vector of speed, red - ship) is at some angle to axis(ugly yellow). As you know you can use trygonometric functions to calculate x-speed and y-speed(green and orange) that when added give black vector.

As you press right you increase angle. For the new angle (and black arrow pointin in another direction but wiht the same length) you calculate x-speed and y-speed.  You set them to your ship actor. This should do the trick.
USE PICTURES WHEN YOU ASK SOMETHING!
If I helped you be sure to mention it in your game.

Tutorials + downloads:
http://t4upl.blogspot.com/

ETHproductions

  • *
  • Posts: 430
An easier alternative to calculating x- and y-speed would be to use the 'set velocity' block. Its 'angle' input takes care of all the trigonometry for you. :)
Fontstruct - Stencyl - Website (in progress)

Proud Member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.