Posted: 17th Dec 2002 20:44
This is my code for stairs to walk up. Basically just make a slope with a plain or something and the put it over so static objects for stairs and it looks like your walking up them ("jump" is turned on when/if you jump and off when you land).


+ Code Snippet
Rem Test for collision
if object collision(1,0)>0
	obj#=object collision(1,0)
	Rem While the player is touching the slope, increase the players y-pos by 1
	while object collision(1,obj#)0
		y#=y#+1
		position object 1,x#,y#,z#
	endwhile
	Rem Adjust y-pos to stop the character vibrating(well it did on my program anyway)
	y#=y#-1
	Rem If the move was to much/slope was too steep then move player back
	if y#>oldy#+10 then x#=oldx#:y#=oldy#:z#=oldz#
	Rem Set players gravity to zero
	pgrav#=0
	jump=0
endif


Criticism(constructive please)?