Need help with aircraft orientation after plane rotates left or right please! :O
quantumsheep
Member Posts: 8,188
Hello everyone!
Maths time, I think!
I was messing about with Attack of the Kraken for the update, and something has irked me since that game. Mainly, that the player rocket is always orientated the right way because it's symmetrical.
i.e. it has no proper 'up or down'.
Video Here:
I was just mucking about with it and wondered if anyone had any ideas as to how to make a plane (with a cockpit on top) 'flip' so that its belly is always facing the ground.
At the moment, the plane loops the loop but is 'upside down' when flying to the left.
Am I making this clear? Do you get where I'm coming from?
I've personally no idea how to implement this, so I'd really love some help!
To recap:
Plane flies to the right with cockpit on top of graphic.
When plane rotates right or left, and ends up flying to the left, the plane is upside down (cockpit on bottom)
Many thanks in advance for the people far cleverer than I!
Cheers,
QS
Maths time, I think!
I was messing about with Attack of the Kraken for the update, and something has irked me since that game. Mainly, that the player rocket is always orientated the right way because it's symmetrical.
i.e. it has no proper 'up or down'.
Video Here:
I was just mucking about with it and wondered if anyone had any ideas as to how to make a plane (with a cockpit on top) 'flip' so that its belly is always facing the ground.
At the moment, the plane loops the loop but is 'upside down' when flying to the left.
Am I making this clear? Do you get where I'm coming from?
I've personally no idea how to implement this, so I'd really love some help!
To recap:
Plane flies to the right with cockpit on top of graphic.
When plane rotates right or left, and ends up flying to the left, the plane is upside down (cockpit on bottom)
Many thanks in advance for the people far cleverer than I!
Cheers,
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Comments
Right - I have:
If self rotation is less than or equal to 90
or
If self rotation is greater than or equal to 270
Change attribute game.moveleft to false.
I also have:
If self rotation is greater than 90
or
If self rotation is less than 270
Change attribute game.moveleft to true
I then put change to a left facing graphic in to the 'moveleft is true' bit and a right facing graphic in the 'moveleft is false' bit.
The left facing graphic comes on but seems to clash with the right facing graphic (i.e. it'll come on and off)
I may have my angles wrong... but I did attempt it at least!
Any other thoughts on what I've done spectacularly wrong?
Cheers,
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Any help in the meantime would be appreciated - I just think it's more complicated than it might at first seeem!
Cheers,
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Ill try to find a range for the numbers for you
http://gamesalad.com/game/7100
Press left or right to rotate the plane
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Ill keep playin around with it though
If you let me know *your* email address, I can send you a quick demo of what I have... Sales, as with all my titles, have not been great at all (though to date it's my best selling title!).
An update has been submitted to Apple, and I'll be reducing the price in the new year to $.99
As I was doing the update I realised I really like the controls and the movement, so I'm experimenting with a new game idea based off it. It's already got some major additions to it which I'm quite excited about
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
It's 8am - I'm off to bed I think!
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Its 4am here, and im wide awake haha
Thanks John - you fixed that dead quick - and yes, I was right - it did involve nasty maths!
Cheers for the help fella! Your name in lights (or in the credits rather) if the game ever gets published.
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
John