Jump to content

Scoring engine


kelvindavies11
 Share

Recommended Posts

Hi guys and girls,

I am creating a  2d sim tower type game and have a question relating to points and scoring engine.

 

Scenario:

 bedroom will generate 2 people

 entertainment room will consume 2 people for entertainment and one for work

 work will consume 2 people for work

 

I am look for some help in generating a algorithm which identifies if I have enough people for entertainment/work.   Any help appreciated.

 

At the moment i have:

 Required bedroom=  (entertainment+work )-people;

 Required work = (people/2)- work

 Required entertainment = (people/2)- entertainment 

 

 

 

Thank you guys,

Kelvin

Link to comment
Share on other sites

How about plus and minus?

var availablePeople = 0;

When a room is created:

availablePeople += 2;

You can give each room a requirement of necessary free/available people to be created. Bedrooms have 0 as requirement for example.

And then a room can generate/consume people.

function OnCreation() {    availablePeople += this.peopleGenerated;}function OnDestruction() {    availablePeople -= this.peopleGenerated;}

It's consumed if peopleGenerated is negative.

 

 

If you have different pools of people to consume, create different variables. Treat it like resources, mana or gold.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...