1
/* This example shows how to use soft bodies.
3
* Soft bodies have an attribute to change how much it will
4
* deforms when colliding. It's called "hardness", and can
5
* be set to any value between 0.0 (soft) and 1.0 (hard).
6
* By default, all the soft bodies are hard (1.0).
8
* This example will make a box and a sphere collide
9
* many times against the floor and will be placed at
10
* top of the screen again. They will have their hardness
11
* modified each time, going from the default to a very
14
* It can be tested with edje_player
15
* $ edje_player physics_soft_bodies.edj
21
image: "bubble-blue.png" COMP;
25
name: "example_group";
34
color: 255 255 255 255; /* white */
35
rel1.relative: 0.0 0.0;
36
rel2.relative: 1.0 1.0;
43
physics_body: SOFT_BOX;
46
color: 255 0 0 255; /* red */
47
rel1.relative: 0.75 0.1;
48
rel2.relative: 0.95 0.3;
57
inherit: "default" 0.0;
63
state: "very_soft" 0.0;
64
inherit: "default" 0.0;
74
physics_body: SOFT_CYLINDER;
77
rel1.relative: 0.25 0.1;
78
rel2.relative: 0.45 0.3;
81
normal: "bubble-blue.png";
91
inherit: "default" 0.0;
92
physics.hardness: 0.8;
95
state: "very_soft" 0.0;
96
inherit: "default" 0.0;
97
physics.hardness: 0.4;
104
physics_body: BOUNDARY_BOTTOM;
106
state: "default" 0.0;
117
physics_body: BOUNDARY_RIGHT;
119
state: "default" 0.0;
130
physics_body: BOUNDARY_LEFT;
132
state: "default" 0.0;
144
name: "stop,go_soft";
147
action: PHYSICS_STOP;
149
target: "blue_circle";
155
action: STATE_SET "soft" 0.0;
157
target: "blue_circle";
158
after: "stop,go_very_soft";
162
name: "stop,go_very_soft";
164
action: PHYSICS_STOP;
166
target: "blue_circle";
167
after: "go_very_soft";
171
name: "go_very_soft";
172
action: STATE_SET "very_soft" 0.0;
174
target: "blue_circle";
175
after: "stop,go_default";
179
name: "stop,go_default";
181
action: PHYSICS_STOP;
183
target: "blue_circle";
189
action: STATE_SET "default" 0.0;
191
target: "blue_circle";
192
after: "stop,go_soft";