![]() |
Gravity
Well, can anyone tell me how to go about making a gravity script, cause I havent the slightest idea of how to make one.
Just for the record, I'm not asking for a full script so don't give me one, just explain how I should go about doing it, if you know. |
Think about the player’s position in the level.
[playerx,playery] |
I know that but...
|
But what? that's all you mainly need to know.
Are you using pics1.png? |
well, we are going to use an edit of it.
ahhhh, now i understand the basic concept of it. =] now to try...but, I need to knwo how to do the onwall checking for moving the player like there's gravity, so the player doenst just go through a wall. |
If you're editing the pics1.png I don't think you need a onwall part :o.
(Not to sure on this though, sorry) |
Well, can anyone tell me of any errors in this, or if this will work. (Im sure theres at least one error cause rc keeps saying there is, but I can't isolate it)
PHP Code:
|
Don't mix sleeps and timeouts.
Also: KSI-GS. |
Horrible.
PHP Code:
Try to keep it short and simple, and make sure that you don't get conditions where events should go... Use KSI-GS... Think about what you really want. --- EDIT: Something you might want to take in consideration is that the gravitational pull accellerates with time. Thereby, a constant for the decrease wouldn't be what you're aiming for. |
Umm, I'm not that great of a scripter so if you could explain that whole thing out for me that would be great. So i can understand what all that means xD
|
PHP Code:
PHP Code:
PHP Code:
this.my = 1 - 0 = 1; That would make it go towards the right. If no keys are pressed, this.my = 0;... If only the up key is pressed... this.my = 0 - 1 = -1; So, it would go up. Onwall tests the actual movement. PHP Code:
PHP Code:
The rest of the script works with the actual moving of the character. |
This better?
PHP Code:
|
For a true gravity affect this.speed should increase over time.
|
Yes. And you can simplify the equation of the movement to what I told you earlier:
PHP Code:
I don't even know why you check for clientr.grav. |
Try this...
PHP Code:
|
Quote:
|
Quote:
|
Quote:
|
I know but i made my possible. I'm trying to check for bugs...
|
ewwwwww......
kaimetsu.. did you lose your modship or something? O.o back in the old day's you'd be ripping these threads up. did someone.....BREAK you?? |
Hes not as hardcore anymore. Duh!
|
I think i'm going to cry!
:( Kaimetsu isn't a hardass anymore? BUT WHO WILL SPANK ME!? |
Quote:
|
Enough with the homosexual jokes :\
Haha, Jagen you dirrty boy :) |
Quote:
|
Quote:
|
Quote:
seriously though, where did the dictatorship go? it's like the drama dried up! :( |
Quote:
Just giving out code willy-nilly is not learning how to script! Quote:
Fine just spank him. Leave nothing for me. Fine. edit: I'm back. =-) |
| All times are GMT +2. The time now is 07:48 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.