Custom Function Pack - - Request yours

Game Editor comments and discussion.

Custom Function Pack - - Request yours

Postby Hblade » Thu Jun 04, 2009 10:41 pm

Custom Function Pack Request a function and I will see what I can do.
Functions available in this pack:
    Playtime
    FillColorCanvas
    SmoothMovement
    ChangeColor
    Visible
    SaveFile
    LoadFile
View the Read me file for instructions and how to use.
Code: Select all
//                FUNCTIONS - Craig Ramsey//
//         Welcome to the list of functions                     View the readme file
//         I made using Game Editor, these                      for information on how
//         functions are easy to use, enjoy.                    to use these functions.



                               // Defines
#define true 1
#define false 0
                               // INT variables
int framecount;
int temp;
int i;
int seconds;
int minutes;
int hours;
int fps = 30;   //Set your framerate here.
                                //Char variables
char *key=GetKeyState();
void Playtime()
{
    framecount = framecount + 1;
    if (framecount == fps * 3)
    {
        framecount = 0;
        seconds = seconds + 1;
    }
    if (seconds == 60)
    {
        minutes = minutes + 1;
        seconds = 0;
    }
    if (minutes == 60)
    {
        minutes == 0;
        hours = hours + 1;
    }
}
void FillColorCanvas(int r, int g, int b, int transparency)
{
    erase(r, g, b, transparency);
}
void SmoothMovement(int distancex, int distancey, int speed)
{
    MoveTo("Event Actor", distancex, distancey, speed, "Event Actor", "");
}
void ChangeColor(int rh, int gh, int bh)
{
    r = rh;
    g = gh;
    b = bh;
}
void Visible(int ifvisible)
{
    if (ifvisible == 0)
    {
        transp = 1;
    }
    if (ifvisible == 1)
    {
        transp = 0;
    }
}
void SaveFile(char * filename, char str[255])
{

  FILE*file;
   file = fopen(filename, "w+b");

  fwrite(str, sizeof(file), 1, file);

  fclose(file);
}
void LoadFile(char * name, char * store)
{
    FILE*file;

   file = fopen(name, "r+b");
    fread(&store, sizeof(store), 1, file);

   fclose(file);
}
Attachments
Functions.zip
(30.58 KiB) Downloaded 90 times
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Custom Function Pack - - Request yours

Postby Fojam » Fri Jun 05, 2009 3:17 pm

that is awesome!
can you make a function that lets you do something, wait an amount of time, and then do another thing without having to use a timer?
CLICK TO GIVE ME POINTS

My Latest Projects:
Super Smash Bros: viewtopic.php?f=6&t=12307 PLEASE help by making sprites!
User avatar
Fojam
 
Posts: 513
Joined: Thu Mar 19, 2009 10:02 pm
Location: under your bed!!!
Score: 69 Give a positive score

Re: Custom Function Pack - - Request yours

Postby Hblade » Fri Jun 05, 2009 3:39 pm

I already have that, :D In my sig, just click "My custom functions", you'll see it there.
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Custom Function Pack - - Request yours

Postby factorman2 » Fri Jun 05, 2009 11:14 pm

can you make a simple save function? :D I'd really appreciate it.
I know, you don't remember me.
factorman2
 
Posts: 59
Joined: Thu May 07, 2009 7:13 pm
Score: 2 Give a positive score

Re: Custom Function Pack - - Request yours

Postby Hblade » Sun Jun 07, 2009 7:15 pm

It would be hard to make an advanced save function, but I will try.
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron