cassius Posted August 17, 2015 Posted August 17, 2015 When my main character is killed ( in sword fight) I need to end the game. Currently I have Delay 5000 followed by return false but for some reason the "die" animation only gets half way thru before the program ends. n there is also a scream sound effect which sometimes occurs but at other times does not. How should I smoothly end the game? Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++
Josh Posted August 17, 2015 Posted August 17, 2015 exit(0)? Quote Let's build cool stuff and have fun.
cassius Posted August 17, 2015 Author Posted August 17, 2015 Ok exit(0) replaced return false. This time the sound effect worked and the attack anim stopped but program ended before die anim could play.Below is the "die" anim code void kill_jane() { if (jane.frame < jane.animlength) { jane.model->SetAnimationFrame(jane.frame, 1, jane.seq); jane.frame = jane.frame + 0.5; } if (jane.frame >= jane.animlength) { scream->Play(); jane.alive = false; } } EDIT :jane.fame starts at 0 and counts up to animlength ie 66 frames Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.