5 static const float JUMPSPEED=600;
7 Jumpy::Jumpy(LispReader& reader)
9 reader.read_float("x", start_position.x);
10 reader.read_float("y", start_position.y);
11 bbox.set_size(31.8, 31.8);
12 sprite = sprite_manager->create("jumpy");
16 Jumpy::write(LispWriter& writer)
18 writer.start_list("jumpy");
20 writer.write_float("x", get_pos().x);
21 writer.write_float("y", get_pos().y);
23 writer.end_list("jumpy");
27 Jumpy::collision_solid(GameObject& , const CollisionHit& hit)
30 if(hit.normal.y < -.5) {
31 physic.set_velocity_y(JUMPSPEED);
32 } else if(hit.normal.y < .5) { // bumped on roof
33 physic.set_velocity_y(0);