Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Реализация логики самолета разведчика. #9

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

Serentiny
Copy link

Закончена реализация логики полетов самолета-разведчика. В нее входит:

  1. Запуск самолетов происходит с наличием минимального интервала в секунду
  2. Корабль может запустить самолет лишь находясь на месте, либо при движении прямо с 'небольшим' рысканьем
  3. Производится расчет предпочтительных линейной и угловой скоростей для удержания заданного расстояния до корабля и предыдущего запущенного самолета

P.S.: Делаю pull-request за подходом ограничений по времени к концу, но планирую продолжить работу в своей ветке для более качественной реализации полетов и посадки через глиссаду.

1) __init__
2) vertices (instead PlaneShape)
3) fixtureDef (without collision with water objects)

Added hotkey H to launch airplanes
Set airplanes capacity to 5
Set initial angle of airplane to angle of Ship
Set initial position of airplane to center of Ship

Removed "Kill me" code chapter :)
…dynamic creating and destroying

Removed keyhook to 'h' from ShipGame to PlaneManager
Removed colliding between planes
Added appear and disappear functions for planes
+ settings sliders for speed boundaries
+ isGoingForward() for Ship
+ settings argument to Plane update
+ cooldown 1 second to launches airplanes
+ state phases to planes (need more)
+ calculated target to move (work wrong, but plane create circles with radius more then dist)
Realized all maneuvers except last
The task is complete, but it would be nice, if i can continue it to make algorithm 'better')
Moved class Plane to new file
Changed "60.0" in angles to math.radian
Added some comments
All plane states moved to another class (sort of enum)
Now isGoingForward() check only angle, no velocity
Replaced b2.. constructors
Some general functions are taken out from class
Removed unnecessary states
Refactored variables names to one style
Changed scout algorithm
Added angle and linear deceleration
Changed 'math.fabs' to 'abs'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant