mirror of
https://github.com/zoriya/Twac.git
synced 2026-05-24 23:25:58 +00:00
Removing the max acceleration value of the jump component
This commit is contained in:
@@ -14,7 +14,6 @@ struct jump_action
|
||||
{
|
||||
gc_component base;
|
||||
int acceleration;
|
||||
int max_acceleration;
|
||||
};
|
||||
|
||||
extern const struct jump_action jump_action;
|
||||
@@ -12,7 +12,7 @@
|
||||
<gravity_component speed="2000" />
|
||||
<keyboard_controller left="16" right="3" jump="57" />
|
||||
<walk_action acceleration="3000" max_acceleration="10000" />
|
||||
<jump_action acceleration="7000" max_acceleration="100000000"/>
|
||||
<jump_action acceleration="7000"/>
|
||||
<friction_component value=".7" />
|
||||
<collision_component />
|
||||
</gc_entity>
|
||||
|
||||
@@ -24,7 +24,6 @@ static void fdctr(gc_scene *scene, void *component, node *n)
|
||||
struct jump_action *cmp = (struct jump_action *)component;
|
||||
|
||||
cmp->acceleration = xml_getintprop(n, "acceleration");
|
||||
cmp->max_acceleration = xml_getintprop(n, "max_acceleration");
|
||||
(void)scene;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ gc_entity *entity, float dtime)
|
||||
struct movable_component *mov = GETCMP(movable_component);
|
||||
struct jump_action *jump = GETCMP(jump_action);
|
||||
|
||||
if (col->distance_down == 0 && mov->acceleration.y < jump->max_acceleration)
|
||||
if (col->distance_down == 0)
|
||||
mov->acceleration.y += con->jumping * jump->acceleration;
|
||||
(void)system;
|
||||
(void)dtime;
|
||||
|
||||
Reference in New Issue
Block a user