ID:153899
 
I was thinking of making a football game, it would be like

Pick a play: Long Pass, Short Pass, Medium Pass

and things like , run middle, run right, run left, etc.

I was wondering how I would keep a track of the first downs.... (Including loss of yards, penalties, etc)

Generally, it's usually 10 yards for a first down.

Any ideas?
The first down line is a fixed point at the beginning of any set of downs... Ten yards from the starting line of scrimmage...

So regardless of penalties, the line remains where it was set at the beginning of the downs... All you've got to do is set its yard line to a variable, and then if the ball makes it past that yard line, there's a first down... Penalties and other losses of yards won't cause any conflict with keeping track of the first down...
Yeah, you could just have FirstDown be a variable and do something like:

Kickoff returned to the 20 Yard Line, Bear's first down at the 30.
( var/FirstDown = 30
var/Pos = 20
var/Play = "Run Middle"
var/CurrentDown = 1
}

1st & 10: Bears run up the middle for 3 yards
{ var/FirstDown = 30
var/Pos = 23
var/Play = "Screen Pass"
var/CurrentDown = 2
}

2nd & 7: Bears pass Complete for gain of 5 yards
{ var/FirstDown = 30
var/Pos = 28
var/Play = "Run Left"
var/CurrentDown = 3
}

3rd & 3: False Start: 5 Yard Penalty; repeat down
{ var/FirstDown = 30
var/Pos = 23
var/Play = "Deep Pass"
var/CurrentDown = 3
}

3rd & 8: Incomplete Pass
{ var/FirstDown = 30
var/Pos = 23
var/Play = "Punt"
var/CurrentDown = 4
}

And that would just continue with Offense & Defense changing places appropriately. :-)
In response to ShadowWolf
So you're suggesting that I make a new variable for each down and play.... ???

I'm confused.
Sariat wrote:
I was thinking of making a football game, it would be like

Pick a play: Long Pass, Short Pass, Medium Pass

and things like , run middle, run right, run left, etc.

I was wondering how I would keep a track of the first downs.... (Including loss of yards, penalties, etc)

Generally, it's usually 10 yards for a first down.

Any ideas?

What about a text MUD football game...

Punkrock546
In response to Punkrock546
What the hell does Roleplaying and Football have to do with each other?
In response to Sariat
Instead of actually playing it would be like listening to a game...

Punkrock546
In response to Sariat
Sariat wrote:
So you're suggesting that I make a new variable for each
down and play.... ???

Me too. I don't believe ShadowWolf means building a new set of vars for each possibility - that would be insane, and very in-efficient - but to take his idea and make a proc() out of it would be a good thing.