Charas-Project

  • Home
  • Help
  • Search
  • Calendar
  • Login
  • Register
*
Please login or register.

Login with username, password and session length
 

News:

New forum theme up and running!



  • Charas-Project »
  • Off-Topic »
  • Archive »
  • Really Old Stuff »
  • General programming »
  • Mini Games Tutorial
« previous next »
  • Print
Pages: [1]

Author Topic: Mini Games Tutorial  (Read 2796 times)

Offline aznmyst

  • You tell me what's my title
  • Initiate
  • *
  • Posts: 24
  • AIM SN: aznxcharlie
Mini Games Tutorial
« on: June 17, 2004, 09:57:31 PM »
Does anyone know how to program an event where the hero has to sneak behind an enemy, but if the enemy turns around and your hero is infront of him, you have start over again?
Logged
I try to bring something new!

Offline WarxePB

  • Action Sue
  • Royal
  • *
  • Posts: 3,601
  • What killed the dinosaurs?
    • The Gigaverse
(No subject)
« Reply #1 on: June 17, 2004, 10:04:13 PM »
Hmm... Do this.

-Get the X coordinates of the hero and the guard.
-Subtract 3 or 4 from the hero's X coordinate.
-Check if the guard and the hero are facing up.
-Check if the hero's X coordinate is greater or equal to the guard's X coordinate.
-If it is, teleport the hero to the starting point.
-If it isn't, do nothing.

Make sure that the guard is Parallel Process.

And, it doesn't have to be Up, either. If you want to use different directions, then do this:

-Left: Get Y, subtract
-Right: Get Y, add
-Down: Get X, add

If you need more clarifacation, just ask.
Logged
Blog: The Gigaverse
Twitter: Initial Chaos

  • Print
Pages: [1]
« previous next »
  • Charas-Project »
  • Off-Topic »
  • Archive »
  • Really Old Stuff »
  • General programming »
  • Mini Games Tutorial
 

  • SMF 2.0.10 | SMF © 2015, Simple Machines
  • XHTML
  • 2O11
  • RSS
  • WAP2
  • Simple Machines Forum