A Few Important Q's Bout My Game

8 replies to this topic

#1 v1p3r2170

v1p3r2170

GMC Member

• New Member
• 31 posts

Posted 21 August 2008 - 02:32 PM

1.) How do you make slopes and make chars go up or down them?

2.) When my character moves the animation stays on the first subimage how do i make it go through all of them when he moves?

3.) how do i make it so the gravity is under water and change back when on land?

Please answer tto the ones you know because this is really important for my game.

Thank you
• 0

#2 MonopolyKing

MonopolyKing

GMC Member

• New Member
• 938 posts

Posted 21 August 2008 - 03:01 PM

1.) How do you make slopes and make chars go up or down them?

```RIGHT KEY EVENT

if (place_free(x+1,y))
{
x+=3
if (place_meeting(x,y-1,obj_slope))
{
for (i=0;i<5;i+=1)
{
y-=i
}}}```
Its off the top of my head, so some adjustments may be neccessary

2.) When my character moves the animation stays on the first subimage how do i make it go through all of them when he moves?

image_speed

3.) how do i make it so the gravity is under water and change back when on land?

Maybe you can create a variable and make it true when he is under-water (and false when he is on land) and then do something like this:
```if (under_water==true) //In the water
{
gravity = #
}
if (under_water==false) //On Land
{
gravity = #
}```

Edited by MonopolyKing, 21 August 2008 - 03:02 PM.

• 0

#3 v1p3r2170

v1p3r2170

GMC Member

• New Member
• 31 posts

Posted 21 August 2008 - 03:53 PM

1.) How do you make slopes and make chars go up or down them?

```RIGHT KEY EVENT

if (place_free(x+1,y))
{
x+=3
if (place_meeting(x,y-1,obj_slope))
{
for (i=0;i<5;i+=1)
{
y-=i
}}}```
Its off the top of my head, so some adjustments may be neccessary

2.) When my character moves the animation stays on the first subimage how do i make it go through all of them when he moves?

image_speed

3.) how do i make it so the gravity is under water and change back when on land?

Maybe you can create a variable and make it true when he is under-water (and false when he is on land) and then do something like this:
```if (under_water==true) //In the water
{
gravity = #
}
if (under_water==false) //On Land
{
gravity = #
}```

I use the icons not code what would i do for them with the icons?
• 0

#4 Ashimura

Ashimura

GMC Member

• New Member
• 77 posts

Posted 21 August 2008 - 03:57 PM

You use D&D?

A more drawn-out way to use some of these codes (like the if's) then use the If expression is true icon, and then the variable icon.

Although it's a lot easier to do by just copy/pasting the code...
• 0

#5 MonopolyKing

MonopolyKing

GMC Member

• New Member
• 938 posts

Posted 21 August 2008 - 06:36 PM

I cant help you with the D&D functions because to be honest, I really never used them, so I dont know their appearances off the top of my head. But if I had GM opened infront of me to see what the icons looked like, then I would be able to help.
• 0

#6 Darth

Darth

GMC Member

• New Member
• 436 posts

Posted 21 August 2008 - 06:42 PM

If you're still using D&D and want to do this (particularly the first), I recommend you begin a gradual transition to code. Besides, you will find it easier to get help.
• 0

#7 Dannerz

Dannerz

GMC Member

• GMC Member
• 177 posts

Posted 21 August 2008 - 06:57 PM

in the end step event:

repeat(10){if place_meeting(x,y,slope_object) y-=1;}

This will take you out of the slope and put you on its surface right away, not too high and not too low.
it's a simple and easy way to make sure the guy walks up the slopes, but he can still have his gravity and all of that too.

make sure precise collision checking is on with the slope's sprite, too.

Edited by Dannerz, 21 August 2008 - 07:00 PM.

• 0

#8 v1p3r2170

v1p3r2170

GMC Member

• New Member
• 31 posts

Posted 23 August 2008 - 04:33 PM

in the end step event:

repeat(10){if place_meeting(x,y,slope_object) y-=1;}

This will take you out of the slope and put you on its surface right away, not too high and not too low.
it's a simple and easy way to make sure the guy walks up the slopes, but he can still have his gravity and all of that too.

make sure precise collision checking is on with the slope's sprite, too.

yeah i use d&d
• 0

#9 fatgecko

fatgecko

GMC Member

• New Member
• 249 posts

Posted 23 August 2008 - 04:48 PM

in the end step event:

repeat(10){if place_meeting(x,y,slope_object) y-=1;}

This will take you out of the slope and put you on its surface right away, not too high and not too low.
it's a simple and easy way to make sure the guy walks up the slopes, but he can still have his gravity and all of that too.

make sure precise collision checking is on with the slope's sprite, too.

yeah i use d&d

i have an idea for the gravity underwater. do something like when object comes in collision with water obj set the gravity to 1.0 or whatever you want. you can do that easily with d&d but when he comes out of water.... hmmm.... i think you would do in step event for the guy check if collision w/ waterobj (click the NOT on the bottom) and then set the gravity to 0. that should work but idk. try it out.
• 0

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users