[go-nuts] Conway's Game of Life and Pong

90 views
Skip to first unread message

Michael Fellinger

unread,
May 2, 2010, 1:58:21 PM5/2/10
to golan...@googlegroups.com
Hi Guys,

I made an implementation of Conway's Game of Life, it's one of my
first real apps, so I'm eager for feedback on anti-patterns I'm using
or other things that could use improvement.
This needs Go-SDL to be installed, it doesn't use sounds or fonts, so
should be easy to get going:
http://gist.github.com/386299


And if you felt that's not interactive or fun enough, try Pong:
http://gist.github.com/379723

--
Michael Fellinger
CTO, The Rubyists, LLC

Andrew Gerrand

unread,
May 2, 2010, 8:31:21 PM5/2/10
to Michael Fellinger, golan...@googlegroups.com
This looks really nice.

Which SDL bindings are you using? http://github.com/banthar/Go-SDL ?

Are you working under Linux or OS X? My initial attempt to get it
going under OS X failed, but admittedly I didn't try very hard. Should
I try on a Linux machine?

Andrew

Steven

unread,
May 2, 2010, 11:02:40 PM5/2/10
to Andrew Gerrand, Michael Fellinger, golan...@googlegroups.com
On Sun, May 2, 2010 at 8:31 PM, Andrew Gerrand <a...@golang.org> wrote:
This looks really nice.

Which SDL bindings are you using? http://github.com/banthar/Go-SDL ?

Are you working under Linux or OS X? My initial attempt to get it
going under OS X failed, but admittedly I didn't try very hard. Should
I try on a Linux machine?

Andrew

That looks like the one I used. I had to install SDL (various different packages) in order to build Go-SDL. I don't know how one would do that in OSX/Darwin. 

Really cool programs :)

adam_smith

unread,
May 6, 2010, 7:35:26 AM5/6/10
to golang-nuts

> first real apps, so I'm eager for feedback on anti-patterns I'm using
> or other things that could use improvement.
Haven't tried it yet. Just skimmed through some of the code. Looked
mainly at Pong. I guess what makes sense in a large program
isn't necessarily what makes sense in a small one.

But if it was a bigger game I think I would make a Sprite interface
type and let Paddle, Enemy and Ball implement this. The way your game
works now you can't treat
Ball, Paddle and Enemy as the same.

But if we stick to the fact that the game is small:
It doesn't seem like Paddle and Enemy share much functionality, so
there is perhaps no point in forwarding from Enemy to Paddle in your
code (the embedding). I think you could have used: "type Enemy Paddle"
to have Enemy use the same storage structure as Paddle but be of a
different type.
Reply all
Reply to author
Forward
0 new messages