Hello,this is my first post. In currently a student going into comp sci. I'm not really going to deep in the graphics part of programming but i guess it would help to know a little.
anyway,to the point.
I have to make a program using .bmp images and land a ship on a planet.which is pretty simple...but one part im stuck...i have it looping to move my image across the screen...at the end of the loop i have to display an image make it blur...flip(pretty much do a few basic image functions)....im going to post my code so u can see and attach my file if anyone has time to help or look.
#include "DarkGDK.h"
void setup();
void landship(int,int,int);//proto
void landship2(int,int,int);
void landship3(int,int,int);
void landship4(int,int,int);
void landship5(int,int,int);
void landship6(int,int,int);
void landship7(int,int,int);
void cow();
void DarkGDK(void)
{
int x=480;// rate at which my .bmp will move
int xrate=20;
int y = 400;
int yrate = 20;
// Turn on the sync rate and set the maximum rate to 60 fps.
dbSyncOn ( );
dbSyncRate (60);
//duh
dbSetWindowTitle("INVADERS RUUUN!");// title
setup();
dbSync();
int counter=0;
while (counter<2)// begining of my loop that moves my image
{ counter++;
landship(2,x,y);
x=x-xrate;
y=y-yrate;}
while (counter<3)
{ counter++;
landship2(2,x,y);
x=x-xrate;
y=y-yrate;}
while (counter<4)
{counter++;
landship3(3,x,y);
x=x-xrate;
y=y-yrate;}
while (counter<5)
{counter++;
landship3(3,x,y);
x=x-xrate;
y=y-yrate;}
while (counter<6)
{counter++;
landship4(4,x,y);
x=x-xrate;
y=y-yrate;}
while (counter<7)
{counter++;
landship5(5,x,y);
x=x-xrate;
y=y-yrate;}
while (counter<13)
{counter++;
landship6(6,x,y);
x=x-xrate+40;
y=y-yrate+30;}
while (counter<17)
{counter++;
landship7(7,x,y);
x=x-xrate+40;
y=y-yrate+30;}
while (counter<23)
{counter++;
cow();
}// this is the end of my loop im not sure how to stop and display my image i have to blurr
//below are my functions
}
void landship(int i,int x,int y)
{
dbCLS();
setup();
dbPasteImage(1,0,0,0);
dbPasteImage(i,x,y,1);
dbSync();
}
void landship2(int i,int x,int y)
{
dbCLS();
setup();
dbPasteImage(1,0,0,0);
dbPasteImage(i,x,y,1);
dbSync();
}
void landship3(int i,int x,int y)
{
dbCLS();
setup();
dbPasteImage(1,0,0,0);
dbPasteImage(i,x,y,1);
dbSync();
}
void landship4(int i,int x,int y)
{
dbCLS();
setup();
dbPasteImage(1,0,0,0);
dbPasteImage(i,x,y,1);
dbSync();
}
void landship5(int i,int x,int y)
{
dbCLS();
setup();
dbPasteImage(1,0,0,0);
dbPasteImage(i,x,y,1);
dbSync();
}
void landship6(int i,int x,int y)
{
dbCLS();
setup();
dbPasteImage(1,0,0,0);
dbPasteImage(i,x,y,1);
dbSync();
}
void landship7(int i,int x,int y)
{
dbCLS();
setup();
dbPasteImage(1,0,0,0);
dbPasteImage(i,x,y,1);
dbSync();
}
void cow()
{dbCLS();
/*********************************************************************************************\
this is where i want to put an image make it display blurr and flip etc.
but im not sure how to do it i know to use dbBlurBitmap but i dont know how to
put it in my loop they way i have it set up ...*/
dbPasteImage(8,0,0,0);
dbSync();
}
void setup()
{
//color set green
dbSetImageColorKey(0,255,0);
dbLoadImage("earth.jpg", 1);//images that are being uses and loaded
dbLoadImage("ship1.bmp",2);
dbLoadImage("ship2.bmp",3);
dbLoadImage("ship3.bmp",4);
dbLoadImage("ship4.bmp",5);
dbLoadImage("ship5.bmp",6);
dbLoadImage("ship6.bmp",7);
dbLoadImage("cow.bmp",8);
}