add jumping Derpy animation for intro from Anna Karlik

This commit is contained in:
Sebastian Krzyszkowiak 2012-05-27 00:58:15 +02:00
parent 5065f49b5a
commit 6fd0af0605
3 changed files with 15 additions and 8 deletions

2
.gitignore vendored
View file

@ -3,4 +3,4 @@ allegro.log
others
SuperDerpy.ini
SuperDerpy.bat
sync
sync*

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by Qt Creator 2.5.81, 2012-05-25T22:27:03. -->
<!-- Written by Qt Creator 2.5.81, 2012-05-27T00:39:04. -->
<qtcreator>
<data>
<variable>GenericProjectManager.GenericProject.Toolchain</variable>
@ -60,7 +60,7 @@
<value type="QByteArray" key="ProjectExplorer.ProjectConfiguration.Id">GenericProjectManager.GenericTarget</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">1</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="QString" key="GenericProjectManager.GenericBuildConfiguration.BuildDirectory">/home/dos/git/SuperDerpy</value>
<value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Gcc:{2a0f2a2f-6b3a-4e88-a8f0-c4e642a21298}</value>

View file

@ -28,11 +28,18 @@ void AnimPage(struct Game *game, int page, ALLEGRO_COLOR tint) {
if (game->intro.in_animation) offset = -1*al_get_display_width(game->display) + (cos(((-1*((game->intro.position)%al_get_display_width(game->display)))/(float)al_get_display_width(game->display))*(ALLEGRO_PI))/2.0)*al_get_display_width(game->display) + al_get_display_width(game->display)/2.0;
int amount1 = 2, amount2 = 2;
if (page==3) amount1=3;
if (page==2) amount2=3;
float anim = game->intro.anim;
if (page==3) { amount1=3; amount2=3; }
if (page==5) { amount1=5; amount2=3; anim*=2; }
if (page<6) al_draw_tinted_bitmap_region(game->intro.animsprites[page-1],tint,al_get_display_width(game->display)*0.3125*(int)fmod(game->intro.anim,amount1),al_get_display_height(game->display)*0.63*(((int)(game->intro.anim/amount1))%amount1),al_get_display_width(game->display)*0.3125, al_get_display_height(game->display)*0.63,offset+al_get_display_width(game->display)*0.08, al_get_display_height(game->display)*0.18,0);
if (page<5) al_draw_tinted_bitmap_region(game->intro.animsprites[page],tint,al_get_display_width(game->display)*0.3125*(int)fmod(game->intro.anim,amount2),al_get_display_height(game->display)*0.63*(((int)(game->intro.anim/amount2))%amount2),al_get_display_width(game->display)*0.3125, al_get_display_height(game->display)*0.63,offset+al_get_display_width(game->display)*1.08, al_get_display_height(game->display)*0.18,0);
if (page<6) al_draw_tinted_bitmap_region(game->intro.animsprites[page-1],tint,al_get_display_width(game->display)*0.3125*(int)fmod(anim,amount1),al_get_display_height(game->display)*0.63*(((int)(anim/amount1))%amount2),al_get_display_width(game->display)*0.3125, al_get_display_height(game->display)*0.63,offset+al_get_display_width(game->display)*0.08, al_get_display_height(game->display)*0.18,0);
amount1 = 2;
amount2 = 2;
if (page==2) { amount1=3; amount2=3; }
if (page==4) { amount1=5; amount2=3; anim*=2; }
if (page<5) al_draw_tinted_bitmap_region(game->intro.animsprites[page],tint,al_get_display_width(game->display)*0.3125*(int)fmod(anim,amount1),al_get_display_height(game->display)*0.63*(((int)(anim/amount1))%amount2),al_get_display_width(game->display)*0.3125, al_get_display_height(game->display)*0.63,offset+al_get_display_width(game->display)*1.08, al_get_display_height(game->display)*0.18,0);
game->intro.anim += tps(game, 2);
}
@ -222,7 +229,7 @@ void Intro_Preload(struct Game *game, void (*progress)(struct Game*, float)) {
PROGRESS;
game->intro.animsprites[3] = LoadScaledBitmap("intro/4.png", (int)(al_get_display_width(game->display)*0.3125)*2, al_get_display_height(game->display)*0.63*2);
PROGRESS;
game->intro.animsprites[4] = LoadScaledBitmap("about/letter.png", (int)(al_get_display_width(game->display)*0.3125)*2, al_get_display_height(game->display)*0.63*2);
game->intro.animsprites[4] = LoadScaledBitmap("intro/5.png", (int)(al_get_display_width(game->display)*0.3125)*5, al_get_display_height(game->display)*0.63*3);
PROGRESS;
game->intro.table_bitmap =LoadScaledBitmap("intro/paper.png", al_get_display_width(game->display), al_get_display_height(game->display));