Hello, thanks for visiting GameML, if you are a Game Maker user, this is the site for you, please sign up, or login if you are already a member, or just browse the site! Welcome to GameML!

ATTENTION MEMBERS!!! USERS CAN NOW SIGN UP AGAIN!
Log in

I forgot my password

Search
 
 

Display results as :
 


Rechercher Advanced Search

Site Hits
Free hit counter
These stats started at 0 on July 7th 2009
GameML File Sharing
USERNAME: gamemladmin@gmail.com PASSWORD: gamemlsite Upload Here: http://gameml.iowoi.org/GameML-File-Sharing-h3.htmPlease add only games.
Create A GAMEML BLOG!
Make a Blog on GameML:http://gamemlblogs.wetpaint.com
Keywords


Ramps YUPP!

View previous topic View next topic Go down

Ramps YUPP!

Post by 3d on Sat Aug 15, 2009 3:11 pm

Make the guy move with WASD. In the step event of the character.

(just make the ramp a ramp thats solid.)

call the / ramp solid_object
and the \ ramp solid_object_2

In the players step event put this

if keyboard_check(ord("D")) {
if place_free(x-2,y) {
x-=2;
if place_meeting(x,y+2+1,solid_object) move_contact_solid(270,24);
} else {
if place_free(x-4,y-30){
x-=2;
y-=30;
move_contact_solid(270,30)
}
}
}
if keyboard_check(ord("A")) {
if place_free(x+2,y) {
x+=2;
if place_meeting(x,y+2+1,solid_object) move_contact_solid(270,24);
} else {
if place_free(x+2,y-30){
x+=2;
y-=30;
move_contact_solid(270,30)
}
}
}
if place_free(x,y+1) gravity=1 else gravity=0;


if keyboard_check(ord("D")) {
if place_free(x+2,y) {
x+=2;
if place_meeting(x,y+2+1,solid_object_2) move_contact_solid(270,24);
} else {
if place_free(x+4,y-30){
x+=2;
y-=30;
move_contact_solid(270,30)
}
}
}
if keyboard_check(ord("A")) {
if place_free(x-2,y) {
x-=2;
if place_meeting(x,y+2+1,solid_object_2) move_contact_solid(270,24);
} else {
if place_free(x-2,y-30){
x-=2;
y-=30;
move_contact_solid(270,30)
if place_free(x,y+1) gravity=1 else gravity=0;
}
}
}
}



In the collision with Solid_object

put

if vspeed<0 move_outside_solid(270,room_height) else move_outside_solid(90,room_height)
vspeed=0;

and in the collision with

solid_object_2

if vspeed>0 move_outside_solid(270,room_height) else move_outside_solid(90,room_height)
vspeed=0;


it works heres a video using it: http://www.youtube.com/watch?v=e1DnoXH3TVY

_________________
Creator of GameML, Thanks for Visiting!
avatar
3d
Admin
Admin

Posts : 1227
Points : 42366
GameML Reputation : 66
Join date : 2009-05-31
Age : 35
Location : U.S.A

View user profile http://gameml.iowoi.org

Back to top Go down

Re: Ramps YUPP!

Post by The Dark Ninja on Sat Aug 15, 2009 3:20 pm

i will try that when i get on the computer
avatar
The Dark Ninja
Super 500 GML
Super 500 GML

Posts : 1495
Points : 33144
GameML Reputation : 7
Join date : 2009-06-16
Location : Earth

View user profile http://www.thedakninja.tastyhamgames.com

Back to top Go down

Re: Ramps YUPP!

Post by -js1210- on Sat Aug 15, 2009 3:25 pm

Nice, it is very similar to what is used in my Metroid game
avatar
-js1210-
Super 500 GML
Super 500 GML

Posts : 1298
Points : 32732
GameML Reputation : 27
Join date : 2009-06-02
Age : 22
Location : United States

View user profile http://www.yoyogames.com/members/js1210

Back to top Go down

Re: Ramps YUPP!

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum