generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Object Oriented Programming on ROBLOX

Previous Thread :: Next Thread 
OperationHustle is not online. OperationHustle
Joined: 22 Mar 2016
Total Posts: 259
10 Apr 2016 05:48 PM
Have you guys ever used this?

I'm thinking of doing a zombie storyline game (like Undead Nation or Defenders of Roblox).

I think the best idea would be to have a zombie class where different types of zombies can inherit from the zombie class.

What would you think about that? An OOP design for a game like that?


Report Abuse
DiamondBladee is not online. DiamondBladee
Joined: 24 Feb 2013
Total Posts: 3527
10 Apr 2016 06:03 PM
Use metatables. I use OOP religiously (not literally).

http://wiki.roblox.com/index.php?title=Metatable
Report Abuse
OperationHustle is not online. OperationHustle
Joined: 22 Mar 2016
Total Posts: 259
10 Apr 2016 06:05 PM
Yeah metatables are an essential requirement of OOP on ROBLOX.


Report Abuse
DiamondBladee is not online. DiamondBladee
Joined: 24 Feb 2013
Total Posts: 3527
10 Apr 2016 06:06 PM
OOP and ModuleScripts can seriously organize a game. I'd use FE to top off your good programming habits.
Report Abuse
OperationHustle is not online. OperationHustle
Joined: 22 Mar 2016
Total Posts: 259
10 Apr 2016 06:08 PM
Everything I've made for a few years now has been FE.

The only other thing I'm thinking of right now is expanding OOP to encompass the entire game, more than just zombies.

Perhaps objectives can use OOP? There's be different types of objectives which would inherit from the objective class.

And character classes can inherit from the main character class.

Hell, why not guns? Guns can inherit from a Guns class which inherits from a Tools class.

OOP is pretty exciting to me.


Report Abuse
DiamondBladee is not online. DiamondBladee
Joined: 24 Feb 2013
Total Posts: 3527
10 Apr 2016 06:11 PM
You can create whichever class system you desire. You can even place classes into modules, and if they are a child of another class module, they can inherit. That's one way to do it.
Report Abuse
62GB is not online. 62GB
Joined: 03 Oct 2011
Total Posts: 4157
10 Apr 2016 06:14 PM
OOP <3


class Zombie
{
private string name;
private int age;
private float damage_per_hit;

public Zombie(string name, int age, float damage)
{
this.name = name;
this.age = age;
this.damage_per_hit = damage;
}
}

static void Main()
{
Zombie Frank = new Zombie("Frank",16,2.44);
Zombie Dorthy = new Zombie("Dorthy",4,0.001);
}


Why did I post C# code? I felt the inspiration!
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
10 Apr 2016 06:16 PM
That's nice of you to give names to your zombies.
Report Abuse
62GB is not online. 62GB
Joined: 03 Oct 2011
Total Posts: 4157
10 Apr 2016 06:17 PM
Isn't it? :D
Report Abuse
RightLegRed is not online. RightLegRed
Joined: 02 Oct 2009
Total Posts: 6761
10 Apr 2016 06:19 PM
You say it's C# code but you don't denote your floats as floats when you write them, surely this causes compiation issues?
Report Abuse
62GB is not online. 62GB
Joined: 03 Oct 2011
Total Posts: 4157
10 Apr 2016 06:20 PM
Oh crud, I forgot Right ;-;
Report Abuse
OperationHustle is not online. OperationHustle
Joined: 22 Mar 2016
Total Posts: 259
10 Apr 2016 06:22 PM
@RoflBread

They were humans at one point. They had families.

:(


Report Abuse
62GB is not online. 62GB
Joined: 03 Oct 2011
Total Posts: 4157
10 Apr 2016 06:24 PM
Lol Operations :3
Report Abuse
OperationHustle is not online. OperationHustle
Joined: 22 Mar 2016
Total Posts: 259
10 Apr 2016 06:29 PM
My game's OOP designed, I suppose:

Class Zombie
-> Class Zombie
-> Class Tank
-> Class Witch
-> Class Smoker
etc.

Class Tool
-> Class Gun
-->Class AK-47
etc.
-> Class Melee
-->Class Katana

Honestly I can make my whole game OOP. Interesting.


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image