Page 1 of 1

Simple But Useful: Save Gravity

PostPosted: Mon Mar 07, 2011 1:03 am
by Hblade
This function is a simple one that allows you to save the xvelocity and yvelocity of the actor that applied the code. To use:
Code: Select all
SaveGrav();
UseSavedGrav();



HOW TO:
Make an array variable like this:
GRAV.jpg


This is useful for those who want to make a custom pause menu.
The code: (Place in Global Code)
Code: Select all
void SaveGrav() {
    gravity[0]=xvelocity;
    gravity[1]=yvelocity;
                           }

void UseSavedGrav() {
    xvelocity=gravity[0];
    yvelocity=gravity[1];
                    }