Powered by Invision Power Board

 
    Reply to this topicStart new topicStart Poll

> Acceleration and deceleration, seem to cling to walls and slopes !work
Austria
Black Boo
Posted: Jun 12 2008, 12:26 PM
Quote Post


I swear when I get my hands on him...
[*][*][*][*][*]
[*][*][*][*][*]
[*][*]

Group Icon
Group: Members
Posts: 3624
Member No.: 4777
Joined: 25-November 07

Status: (0d) [--]


So I can't seem to be able to make acceleration and deceleration work. Can someone provide me the code for the almost whole left key press event? Just for flat ground.

This post has been edited by Black Boo on Jun 12 2008, 02:19 PM


--------------------
SGG was here
PMEmail PosterAOLMSN
Top
Unspecified
Miaxis
Posted: Jun 12 2008, 12:27 PM
Quote Post


hagan bromas
[*]

Group Icon
Group: Members
Posts: 1799
Member No.: 2793
Joined: 12-October 06

Status: (0d) [--]


if hspeed<(insert max speed)
hspeed-=0.1(set higher for faster accelerating)


--------------------
user posted image

user posted imageuser posted imageuser posted imageuser posted image
PMEmail PosterUsers WebsiteMSN
Top
United States
Grant
Posted: Jun 12 2008, 12:28 PM
Quote Post


John Freeman said
[*][*][*][*][*]
[*][*][*]

Group Icon
Group: Members
Posts: 8260
Member No.: 2900
Joined: 31-October 06

Status: (0d) [--]


You could look at the Trisoft engine on the main site for help with this. The engine is fairly basic, so it probably wouldn't be hard to find the code that corresponds to this.

(This is assuming you use Game Maker.)


--------------------
user posted image

QUOTE (oh youtube trolls)
u guys r retarded hippocrates

QUOTE (Piemanthe3rd)
Pie is not random. I wish people would realize this.
PMEmail PosterUsers WebsiteAOLMSN
Top
Austria
Black Boo
Posted: Jun 12 2008, 12:36 PM
Quote Post


I swear when I get my hands on him...
[*][*][*][*][*]
[*][*][*][*][*]
[*][*]

Group Icon
Group: Members
Posts: 3624
Member No.: 4777
Joined: 25-November 07

Status: (0d) [--]


QUOTE (Grant @ Jun 12 2008, 12:28 PM)
You could look at the Trisoft engine on the main site for help with this. The engine is fairly basic, so it probably wouldn't be hard to find the code that corresponds to this.

(This is assuming you use Game Maker.)

I've heard of it, but never seen it. Where in the main site?

And latia, I knew that much, but how do you decelerate?

Edit: found the trisoft engine.

This post has been edited by Black Boo on Jun 12 2008, 12:39 PM


--------------------
SGG was here
PMEmail PosterAOLMSN
Top
United Kingdom
Pip
Posted: Jun 12 2008, 12:39 PM
Quote Post


you are now reading my posts in chris tucker's voice
[*][*][*]

Group Icon
Group: Members
Posts: 5151
Member No.: 2941
Joined: 13-November 06

Status: (0d) [--]


QUOTE (Black Boo @ Jun 12 2008, 12:36 PM)
I've heard of it, but never seen it. Where in the main site?

And latia, I knew that much, but how do you decelerate?

Make all negatives positive, and vice-versa.


--------------------
**** are p. cool
PMEmail PosterUsers WebsiteAOL
Top
Unspecified
Miaxis
Posted: Jun 12 2008, 12:40 PM
Quote Post


hagan bromas
[*]

Group Icon
Group: Members
Posts: 1799
Member No.: 2793
Joined: 12-October 06

Status: (0d) [--]


QUOTE (Black Boo @ Jun 12 2008, 07:36 PM)
I've heard of it, but never seen it. Where in the main site?

And latia, I knew that much, but how do you decelerate?

You said left key code, that´s it.<_<
For deceleration:

if !keyboard_check(vk_left) and hspeed<0
hspeed+=0.1

@Pip:You forgot the condidtion.:P

btw Main Site

This post has been edited by Latia on Jun 12 2008, 12:41 PM


--------------------
user posted image

user posted imageuser posted imageuser posted imageuser posted image
PMEmail PosterUsers WebsiteMSN
Top
Austria
Black Boo
Posted: Jun 12 2008, 12:53 PM
Quote Post


I swear when I get my hands on him...
[*][*][*][*][*]
[*][*][*][*][*]
[*][*]

Group Icon
Group: Members
Posts: 3624
Member No.: 4777
Joined: 25-November 07

Status: (0d) [--]


Olay, the Trisoft engine has me confused. O.o

I'm just trying to have mario slow down when I release the key. What I have for acceleration is

hspeed -= 0.2
if hspeed < minspeed
{hspeed = minspeed}
minspeed = -3

Now how do I make him slow down when I release the key?

Latia, you have me confused.


--------------------
SGG was here
PMEmail PosterAOLMSN
Top
Unspecified
Miaxis
Posted: Jun 12 2008, 12:58 PM
Quote Post


hagan bromas
[*]

Group Icon
Group: Members
Posts: 1799
Member No.: 2793
Joined: 12-October 06

Status: (0d) [--]


You´re supposed to put that in the step event.


--------------------
user posted image

user posted imageuser posted imageuser posted imageuser posted image
PMEmail PosterUsers WebsiteMSN
Top
Austria
Black Boo
Posted: Jun 12 2008, 01:01 PM
Quote Post


I swear when I get my hands on him...
[*][*][*][*][*]
[*][*][*][*][*]
[*][*]

Group Icon
Group: Members
Posts: 3624
Member No.: 4777
Joined: 25-November 07

Status: (0d) [--]


Wait, so I put that in the step event...? I'll try, give me a minute.


--------------------
SGG was here
PMEmail PosterAOLMSN
Top
Austria
Black Boo
Posted: Jun 12 2008, 01:32 PM
Quote Post


I swear when I get my hands on him...
[*][*][*][*][*]
[*][*][*][*][*]
[*][*]

Group Icon
Group: Members
Posts: 3624
Member No.: 4777
Joined: 25-November 07

Status: (0d) [--]


Thank you Latia! It worked!

Now could you help me use the same code for slopes? X_X


--------------------
SGG was here
PMEmail PosterAOLMSN
Top
Unspecified
Miaxis
Posted: Jun 12 2008, 01:41 PM
Quote Post


hagan bromas
[*]

Group Icon
Group: Members
Posts: 1799
Member No.: 2793
Joined: 12-October 06

Status: (0d) [--]


Sure. Try this on collision with the slope(originating from Mario´s object):

y=other.y-1

To not confuse you, originating from Mario´s object means you have to put the collision event in MArio´s object.


--------------------
user posted image

user posted imageuser posted imageuser posted imageuser posted image
PMEmail PosterUsers WebsiteMSN
Top
Austria
Black Boo
Posted: Jun 12 2008, 01:44 PM
Quote Post


I swear when I get my hands on him...
[*][*][*][*][*]
[*][*][*][*][*]
[*][*]

Group Icon
Group: Members
Posts: 3624
Member No.: 4777
Joined: 25-November 07

Status: (0d) [--]


QUOTE (Latia @ Jun 12 2008, 01:41 PM)
Sure. Try this on collision with the slope(originating from Mario´s object):

y=other.y-1

To not confuse you, originating from Mario´s object means you have to put the collision event in MArio´s object.

I knew of the origin thing. I'll try that with the slopes.

It's not working.

This post has been edited by Black Boo on Jun 12 2008, 02:15 PM


--------------------
SGG was here
PMEmail PosterAOLMSN
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

  Topic Options Topic Options Reply to this topicStart new topicStart Poll

 




[ Script Execution time: 0.0455 ]   [ 13 queries used ]   [ GZIP Enabled ]   [ Server Load: 0.27 ]