We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexDiscussionExhibition › Two bits of fun with Conway's Game of Life
Page Index Toggle Pages: 1
Two bits of fun with Conway's Game of Life (Read 1178 times)
Two bits of fun with Conway's Game of Life
Nov 3rd, 2007, 6:20pm
 
conwayice:
http://kisrael.com/2007/10/21/

ephemeral blue sculptures made by plotting subsequent generations of 2D Life into 3D, and rotating the result. Two people have independently noted the resemblance to coral...

conway west:
http://kisrael.com/2007/10/26/

(the pun on the pop artist's name is intentional, but regrettable) was made for GloriousTrainwreck.com 's 2 hour Klik of the Month Klub game jam. So in 2 hours I took a borrowed Life engine and made a game out of it where you're a little happyface square who has to run around a Life field, but there's a chaos-provoking ghost who burps out extra cells to stop Life from setting into its repeating blinker ways.
Re: Two bits of fun with Conway's Game of Life
Reply #1 - Nov 4th, 2007, 1:55pm
 
Interesting game, i´m a begginer in Processing and found a problem with my program. How the score box is going? I need something similar but i don´t know how to do it.

The idea of my game is a ball falling from the top that you can "pilot" to right and left. You must to "destroy" a ship that is going from right to left.

So i need that when the ball touch the ship, the score goes up 10 points.

Thanx
Re: Two bits of fun with Conway's Game of Life
Reply #2 - Nov 4th, 2007, 3:10pm
 
Well, I don't have a "score box" exactly, I just print the score every time in the draw routine.

The somewhat tricky thing about using text in processing is setting up a font. There are a few steps:
1. while you're developing your program, add the font it
2. a line of code that says you're using this font
3. a line of code to print the text

These instructions apply at least to Windows:
A. go to the Tools dropdown menu and hit "Create font..."
B. pick a font, one that looks good to you. If you know the Size you're going to want to use the font at already, select it. Otherwise keep the default of 48.
C. Copy the "filename" showing there. In my case, it's "Arial-Black-48" and there's a ".vlw" after it. Then hit OK

So in the setup() of your program, do something like this:
 textFont(loadFont("Arial-Black-48"),20);
that tells it to load that font file (loadFont - you want to do that once, not over and over), and then textFont says start using the font that the loadFont returned.

Once you've done that-- if your score is in a variable called currentScore, and you want it near the top left of the game, something like
text(currentScore,10,20);
where 10 and 20 are the x and y of where it should go.

If it needs to be in a box, just draw a box before you draw the score.
Re: Two bits of fun with Conway's Game of Life
Reply #3 - Nov 4th, 2007, 4:11pm
 
lots of thanx, i will try it

Smiley)
Page Index Toggle Pages: 1