Hi,
I am not an expert in programming, but I have done some very simple games 
with pyglet. I dont know how you could calculate the trajetory of the 
second spaceship directly based on the position fo the first one. But in 
last resort, if you can't figure a better way, a solution is to have a list 
or dictionary, for example, where you could save each comand that the main 
spaceship receives and coords. For example, the player presses left at the 
coord x=500 and y= 40, and realeases the button at coords x=300 and y=40, 
you could save that info, at each new command from the player, in a 
dictionary, and make the second spaceship follow that indications, and 
delete each one after done from the dictionary. 

This may not be the best solution... There are more optimised and simple 
solutions, but I can't remember one at the moment. As I said I am not an 
expert in programming. I have done a simple game with the Snake mechanics 
and made the pieces follow the main player with something like that. But 
certainly there are better ideas, you can do it in many ways.

Kind regards, hope someone more experienced can help you, have fun :)

PS: all the best wishes for the people of this list and the creators of 
pyglet, I follow your work and love the library, but it is my first time 
writing in here, so in needed to thank you all for your great work :)




Sexta-feira, 19 de Abril de 2013 8:39:02 UTC+1, Andreas Grätz escreveu:
>
> Hello,
>
> I have two spaceships. The first is steered by the player, the second 
> should follow the first. How could I calculate if the second ship must turn 
> left or turn right for following the first ship?
>
> Greets
>
> Andreas
>

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyglet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to