游戏之家 > 游戏库 > 星界边境

星界边境跃迁显示代码一览 飞船跃迁滚动代码内容

下面是文和图。有需要的拿去。虽然我觉得没有多少个人像我一样有这种需要……

截图:


转成文本内容:

Void Sky::update(unit64_tcurrtStep) {

m_netStates.updateStep(currentStep);)

Double dt = WorldTimesetp

If (m_referenceClock) {

double clockTime = m_referenceClock-}time();

If

(isnan(m_clockTrackingTime)) {

M_clockTrackingTime =

clockTime;

} else {

//if our reference clock is set,and we have a valid tracking time ,then

//slowly adjust time towards the tracking time based on the

// ‘clockTrackingFctor’setting.

Double clockDiff = clockTime -

M_clockTrackingTime;

Double adjustment =

clockDiff *

m_settings.queryDouble(“clock

TrackingFactor”);

Dt = adjustmen;

M_clockTrackingTime +=

Adjustment;

}

}

M_time += dt;

m_flashTimer = std::max(0.0,

M_flashTimer - dt);

If (flying()) {

m_flyingTimer += dt;

If (m_flyingType ==

FlyingType::Disembarking) {

Bool finished =

M_starOffset -=

M_starOffset *

M_settings.queryFloat(“correctionPower”);

M+planetOffset -=

M_planetOffset *

M_settings.queryFloat(“correctionPower”);

} else if (m_flyingType ==

FlyingType::Interstellar) {

M_flyingVelocity +=

M_flyingAccel *dt *

(int)m_interstellarPhase;

If (m_interstellarPhase)

== InterstellarPhase::Maintain)

{

M_flyingVelocity =

M_settings.queryFloat(“flyMax

Velocity”);

tionPower”);

] else if (m_flyingType ==

FlyingType::Interstellar) [

M_flyingVelocity +=

M_flyingAccel * dt *

(int)m_interstellarPhase::Maintain)

{

M_flyingVelocity =

M_settings.queryFloat(“flyMax

Velocity”);

} else {

M_flyingVelocity =

Clamp(m_flyingVelocity, 0.0f,

M_settings.queryFloat(“flyMaxVelocity”));

}

M_starOffset +=

Vec2F::withAngel(--

getStarRotation(),

M_flyingVelocity * dt *

M_settings.queryFloat(“starVelocityFactor”);

M_planetOffset +=

Vec2F::withAngel(--

getPlanetRotation(),

M_flyingVelocity *dt);

If (m_interstellarPhase)

InterstellarPhase::SpeedingUp

&& m_flyingTimer >=

M_settings.queryFloat(“speedupTimer”)) {

enterHyperspace();