Welcome Guest ( Log In | Register )

[ Big| Medium| Small] -



Post new topic Reply to topic  [ 3 posts ] 
    9robin3
  Tue Jan 18, 2011 2:50 pm
Robin Andblom
User avatar
Member

Party Mascot
Hi! I am using Game Maker 8

I am using the following information for my "Player.Object":

CREATE:
CODE:
grav=.3;
mspeed = 8;

STEP:
CODE:
if (place_free(x,y+1)) {
gravity = grav;
}else{
gravity = 0
}

COLLISION -><- WITH "GROUND":
CODE:
vspeed = 0;

SPACE BUTTON:
CODE:
if!(place_free(x,y+1)) {
vspeed -= 8;}

This scripts are used to make a character JUMP, and I have used them sooo many times before, but suddenly it doesn't work at all!

It is a bug because it just randomly popped up, and when the scripts worked one second earlier too!

Look at this VIDEO if you want a clearer explanation (please look in FULLSCREEN):



PLEASE HELP ME! I am mad at Game maker because I have experienced so many random and unlogical bugs!

/Thank You

_________________
MY PAGES:
MY HOMEPAGE
MY FB GAME PAGE
MY YOUTUBE

__________________________________________________________________________________________
GAMES IN PROGRESS:

Image

Image


Top Top
Profile      
 

    coyotecraft
  Wed Jan 19, 2011 6:34 pm
User avatar
Sponsor

Omnipresent Merchant
Like the error message says, GM doesn't recognize the variable grav

Variables in GM8 are local to objects. If you are going to write a variable in code you need to tell it where that variable is.
instead of:
grav=.3
it needs to say:
mario.grav=.3

But since gravity is a built-in variable I'm assuming you want to make a global variable for grav.
To do that you need to call it:
global.grav=.3
This way you can have all your objects gravity equal to one variable.


Top Top
Profile      
 

    9robin3
  Thu Jan 20, 2011 9:43 am
Robin Andblom
User avatar
Member

Party Mascot
Thank you, once again Coyotecraft!:) Will be trying this

_________________
MY PAGES:
MY HOMEPAGE
MY FB GAME PAGE
MY YOUTUBE

__________________________________________________________________________________________
GAMES IN PROGRESS:

Image

Image


Top Top
Profile      
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 


Who is online

Users browsing this forum: No users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

cron
We are an independent, not-for-profit game making community.
Homepage
Board Index
About Us
Downloadable Games
Free Browser Games
Games in Development
RPG Maker Support
Game Maker Support
Construct 2 Support
HBGames the eZine
Advanced RPG Maker
Site Announcements
Powered by phpBB © phpBB Group