Add food

Bug #628180 reported by Josh Brown on 2010-09-01
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snakes
High
Tom Bell

Bug Description

Currently there is no food for the snake to grow. Food needs to be added to the board at random.

Related branches

Josh Brown (joshbrown) on 2010-09-01
Changed in snakes-game:
importance: Undecided → High
status: New → Triaged
milestone: none → 1.0
Tom Bell (bushbaby2511) wrote :

Randomised food drops added. The food appears elsewhere when the snakes head moves over it

Josh Brown (joshbrown) wrote :

An interesting way of doing things - having each piece of food as a perpetually moving object. I probably would have done things a different way, but it'll do fine for now. Thanks!

Changed in snakes-game:
assignee: nobody → Tom Bell (bushbaby2511)
status: Triaged → Fix Committed
Josh Brown (joshbrown) wrote :
Changed in snakes-game:
status: Fix Committed → Fix Released
Tom Bell (bushbaby2511) wrote :

Fair enough, as far as I was aware the classic snakes had randomised food drops but this can always be changed. No problem.

Josh Brown (joshbrown) wrote :

Tom, what I meant was that a piece of food moving about of it's own accord after it's been eaten seems illogical to me, so I'd delete the piece of food, then create a new piece in a random location.

Your code, in itself, works fine, it's just the object-orientated illogicalness that I object to. But then again, I'm no programming expert so maybe OOP is supposed to be done your way.

Tom Bell (bushbaby2511) wrote :

Ah apologies, I misinterpreted, you're quite right. thanks for the edit.

Tom Bell (bushbaby2511) wrote :

Here's the more logical object-orienteered approach

Josh Brown (joshbrown) wrote :

Thanks for the patch Tom, we may as well remove the `update` function altogether.

Josh Brown (joshbrown) on 2010-09-07
tags: added: feature
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers