Jump to content


Photo

Automatic Slope Movement


  • Please log in to reply
4 replies to this topic

#1 hawk14

hawk14

    GMC Member

  • GMC Member
  • 745 posts

Posted 03 July 2011 - 03:14 AM

Hey I need help with designing a "slope" script for use by AI in my game. Basically you play as a gunship, utilizing "ground forces" which run along the terrain below from both sides and fire at each other from a (side-view perspective.)

All the slope "engines" I've seen are complex scripts integrated heavily into the overall platform game, or only include code for perfectly "ramp-like" slopes. but in this case I ONLY need the slope movement, and IT HAS TO WORK FOR ANY KIND OF SLOPE.

Everything else I can handle just fine.

So, thanks in advance; and the sooner we can get this done with the better. ^_^

Edited by hawk14, 03 July 2011 - 04:05 AM.

  • 0

#2 hawk14

hawk14

    GMC Member

  • GMC Member
  • 745 posts

Posted 03 July 2011 - 09:19 PM

*bump*

..Anyone...?

Edited by hawk14, 03 July 2011 - 09:48 PM.

  • 0

#3 Titanium

Titanium

    the perfectionist

  • GMC Member
  • 1138 posts

Posted 04 July 2011 - 03:41 AM


for(i=-5;i<5;i+=1)

  {

  if(place_free(x,y-i))y-=i

  }


  • 0

#4 hawk14

hawk14

    GMC Member

  • GMC Member
  • 745 posts

Posted 04 July 2011 - 04:02 AM

for(i=-5;i<5;i+=1)
  {
  if(place_free(x,y-i))y-=i
  }

Does that work for dynamic slopes? or only specific inclines?
  • 0

#5 TheMusicDork

TheMusicDork

    GMC Member

  • GMC Member
  • 305 posts

Posted 04 July 2011 - 08:00 AM

Why don't you try it and find out?
But yes it works for dynamic slooes, if you wish to make it go up or down change the -5 and 5 to bigger or smaller numbers.
TMD
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users