You are on page 1of 2

/*

* Praktikum Pemrograman C
* Oleh : .....
* NIM : .....
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <float.h>
#include <limits.h>
#include <SDL.h>
#include <SDL_image.h>
#include <SDL_mixer.h>
#include <SDL_ttf.h>
#include "sprig/sprig.h"
#include "wayang/wayang.h"
int main()
{
//set caption+background
kSetCaption("praktikum 2");
kOpen(800,600,"images/wayang/kelir_01.jpg");
//membuat wayang
hWayang bima;
bima=wCreate(1, "images/wayang/Bima.png");
//memindah+stamp
wJumpTo(bima, -200, -200);
wStamp(bima);
dDelay(1000);
//perhatikan guna setiap fungsi
wJumpTo(bima, -200, -100);
wStamp(bima);
//pergerakan
wJumpTo(bima,0,0);
wShow(bima);
wStepTo(bima,100,100,20);
//say
hUkoro text;
text = uCreate("fonts/truetype/freefont/FreeSerif.ttf", 20);
uSetColor(text,RED);
wSay(bima,text,1000,"hello world");
//if
int hadap;
printf("Ingin menghadap kemana?? 1=atas 2=bawah\n");
scanf("%i",&hadap);
if(hadap==1)
{wTurnTo(bima,90);}
else
{wTurnTo(bima,-90);}
dDelay(2000);
wHide(bima);
//agar tampilannya berhenti sebentar/tidak langsung tutup
dDelay(5000);
return 0;
}

You might also like