thin down the meter rings, and make digging consume energy

This commit is contained in:
darkrose 2015-05-15 22:38:14 +10:00
parent 98796771bb
commit 6b94cdf6ec
4 changed files with 16 additions and 6 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -2110,6 +2110,7 @@ void the_game(
false,
false,
free_move,
false,
camera_pitch,
camera_yaw
);
@ -2140,6 +2141,7 @@ void the_game(
input->isKeyDown(getKeySetting(VLKC_DOWN)),
input->isKeyDown(getKeySetting(VLKC_RUN)),
free_move,
input->getLeftState(),
camera_pitch,
camera_yaw
);
@ -2384,7 +2386,7 @@ void the_game(
InventoryList *mlist = local_inventory.getList("main");
if (mlist != NULL) {
InventoryItem *item = mlist->getItem(g_selected_item);
if (item && (std::string)item->getName() == "ToolItem") {
if (item && (item->getContent()&CONTENT_TOOLITEM_MASK) == CONTENT_TOOLITEM_MASK) {
ToolItem *titem = (ToolItem*)item;
toolid = titem->getContent();
}

View File

@ -1000,19 +1000,23 @@ void LocalPlayer::applyControl(float dtime)
// The speed of the player (Y is ignored)
if (control.fast) {
m_energy -= dtime;
if (speed.X || speed.Y || speed.Z)
m_energy -= dtime;
speed = speed.normalize() * walkspeed_max * 5.0;
}else{
if (m_energy < hp)
m_energy += dtime*2;
if (m_energy > hp)
m_energy = hp;
if (control.digging) {
m_energy -= dtime*0.2;
}else if (m_energy < hp) {
m_energy += dtime*1.5;
}
if (control.sneak) {
speed = speed.normalize() * walkspeed_max / 3.0;
}else{
speed = speed.normalize() * walkspeed_max;
}
}
if (m_energy > hp)
m_energy = hp;
f32 inc = walk_acceleration * BS * dtime;

View File

@ -437,6 +437,7 @@ struct PlayerControl
down = false;
fast = false;
free = false;
digging = false;
pitch = 0;
yaw = 0;
}
@ -451,6 +452,7 @@ struct PlayerControl
bool a_down,
bool a_fast,
bool a_free,
bool a_digging,
float a_pitch,
float a_yaw
)
@ -467,6 +469,7 @@ struct PlayerControl
free = a_free;
pitch = a_pitch;
yaw = a_yaw;
digging = a_digging;
}
bool forward;
bool backward;
@ -478,6 +481,7 @@ struct PlayerControl
bool down;
bool fast;
bool free;
bool digging;
float pitch;
float yaw;
};