Simple But Useful: Save Gravity

Game Editor comments and discussion.

Simple But Useful: Save Gravity

Postby Hblade » Mon Mar 07, 2011 1:03 am

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];
                    }
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