View Single Post
  #20  
Old 02-01-2004, 12:21 AM
Termina_Owner Termina_Owner is offline
Registered User
Join Date: Oct 2003
Posts: 175
Termina_Owner is on a distinguished road
Holy ****! Object-Oriented? That's just awesome!

I haven't been using object-oriented things for a long time, but they were awesome... Erm, for you who don't know... How can I explain:

Object Oriented is something that you can somewhat have a whole new ****load of arrays in a variable, along with it's own function set and all!

As in PHP:
NPC Code:

class dog{
var health;
function bark(){
setcharprop #c,Woof Woof!;
}
function whimper(){
setcharprop #c,Err... Err...!;
}
function attack(otherdog){
otherdog->hurt(5);
}
function hurt(damage){
health = health - 5;
if (health <= 0)
setcharprop #c, Arg... I'm dead;
}
}
if (playerenters){
dog = new dog(10);
healthydog = new dog(100);
healthydog-> bark();
dog-> whimper();
healthydog-> attack(dog);
dog-> attack(healthydog);
healthydog-> attack(dog);
}



Erm... Yea, that seems right... It's having a whole basin of function into a variable... It's basically like classes, but much easier to control... Perhaps in a hat shop, you could have One NPC having control of all the hats there, instead of all the hats having itself as a class...

Say, could we do:
NPC Code:

if (playerenters){
npcs[index].OBJECT-> Function(data1,data2);
}


?
It would be awesome if we could... Anyhow! When is the new engine planned to be released? You got me anxious (Well, more then I actually am).
__________________
- Rance Vicious
Reply With Quote