Ex:
_____________ - Top floor
0
_
| - Me
^
_____________ - Second Floor
_____________ - Ground Floor
Does anyone have any ideas? (code would be greatly appreciated
Posted 17 November 2011 - 11:43 PM
Posted 18 November 2011 - 01:48 PM
Posted 19 November 2011 - 02:19 AM
Posted 21 November 2011 - 09:37 PM
Posted 22 November 2011 - 11:48 AM
Stairs could be a little tricky. You could just apply the same method for checking solid positions, but if there is a stair object, alter the z position.... Andrew's method seem's to work. I need to add real stairs, but it looks good so far. Any tips on how to handle the stairs?
Edited by AndrewBGM, 22 November 2011 - 11:49 AM.
Posted 24 November 2011 - 01:32 AM
Stairs could be a little tricky. You could just apply the same method for checking solid positions, but if there is a stair object, alter the z position.
... Andrew's method seem's to work. I need to add real stairs, but it looks good so far. Any tips on how to handle the stairs?
Also, jheard901, why did you not just link to the file rather than uploading it to your Host-A account?
Posted 26 November 2011 - 04:06 PM
//draw stairs
z=0
{
d3d_draw_block(x,y-32,z, x-64,y+32,z+12, background_get_texture(background1),1,1)
d3d_draw_block(x,y-32,z+12, x-48,y+32,z+24, background_get_texture(background1),1,1)
d3d_draw_block(x,y-32,z+24, x-32,y+32,z+36, background_get_texture(background1),1,1)
d3d_draw_block(x,y-32,z+36, x-16,y+32,z+48, background_get_texture(background1),1,1)
}the stairs sprite's origen must be at the left middle side of a 64x64 sprite.//set z motion stuff zdirection=0; zspeed=0; zgravity=0;Step:
{//check for ramps
if collision_circle(x,y,2,stair,false,false) then
{
zgravity=0;zspeed=0;
near=instance_nearest(x,y,stair);
z=48-distance_to_point(near.x,near.y);
}
else
script_execute(scr_BlockCheck);scr_BlockCheck:z=0
//check for bumping against blocks
if collision_circle(x,y,2,wall_par,false,false) then
{
near=instance_nearest(x,y,wall_par);
if near.z>= z then script_execute(scr_CameraBump);
}
else
{zgravity=1;}scr_CameraBump://camera bumps into solid things x=xprevious; y=yprevious; speed=0;This is what i used any way.
Edited by Popcorn123, 26 November 2011 - 04:09 PM.
0 members, 0 guests, 0 anonymous users