Okamijoe
Member
Hello,
here's a really basic question:
I have not found any dedicated function to make an enemy entity shake when being hit, so I'm wondering which method would be the best to tackle this issue.
As far as I know, there are two ways to do this:
1) Repositioning the sprite in it's graphics file directly, but you'll need to create some extra frames to make that work.
or
2) Changing the offset for each frame in an animation, like this:
Just to make sure that's the ideal way before applying it to all my entities.
Thank you!
here's a really basic question:
I have not found any dedicated function to make an enemy entity shake when being hit, so I'm wondering which method would be the best to tackle this issue.
As far as I know, there are two ways to do this:
1) Repositioning the sprite in it's graphics file directly, but you'll need to create some extra frames to make that work.
or
2) Changing the offset for each frame in an animation, like this:
I guess the offset method would be the better choice? Or is there something else?anim pain
loop 0
delay 10
offset 81 177
bbox 58 81 39 96
sound data/sounds/hipain1.wav
delay 4
frame data/chars/orange/gethithigh1.png
offset 77 177
frame data/chars/orange/gethithigh1.png
offset 80 177
frame data/chars/orange/gethithigh1.png
offset 78 177
frame data/chars/orange/gethithigh1.png
offset 79 177
frame data/chars/orange/gethithigh1.png
delay 10
offset 81 177
frame data/chars/orange/gethithigh2.png
frame data/chars/orange/gethithigh3.png
Just to make sure that's the ideal way before applying it to all my entities.
Thank you!