fredsa / playn

Cross platform game library for N≥4 platforms
0 stars 1 forks source link

Consolidation of samples into Showcase sample #27

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Purpose of code changes on this branch:

Each sample comes with a hefty portion of boilerplate to allow the sample to be 
built and tested on all four supported platforms. As the number of samples 
increase, the number of projects goes up as 5x, and often each of those simple 
samples is dwarfed by the additional build and metadata files needed for a full 
PlayN project.

This patch consolidates the samples into a single Showcase sample. Each sample 
becomes just the core PlayN code needed to implement the sample, along with any 
resources used by the sample. Each sample no longer needs to provide its own 
Java/Flash/HTML/Android bootstrap classes, nor GWT XML files, nor Android 
project files, nor multiple POM files.

This also reduces the Eclipse spam that comes with having myriad samples, since 
each sample introduces five subprojects into Eclipse.

I have left two samples intentionally separate:

hello - which exists to demonstrate all of the boilerplate needed to set up a 
project across all of the platforms, and intentionally lacks a complex core 
implementation

cute - which will hopefully some day evolve into a more complete game 
demonstration that will show how the various features of PlayN are integrated 
into a single non-trivial game

The remainder of the samples are now in Showcase, where they can demonstrate 
individual features of PlayN without getting bogged down in metadata and 
per-platform bits.

The noise sample has not been merged into Showcase yet, because it's not clear 
what it is demonstrating, if anything. I think we should have a sample that 
demonstrates playing and looping sounds, but it should likely be more like 
http://bdg-soundsample.appspot.com/ than the existing noise sample. The latter 
lacks a user interface and does very strange things like playing dozens of 
sounds over top one another in a tight loop.

If you wish to run the sample, the best way is probably to check out my entire 
repository and run it directly from there:

% git clone git://github.com/threerings/playn.git showcase-playn
% cd showcase-playn
% ant install
% cd sample/showcase
% ant run-java
(if you want to test it in the web browser)
% ant run-html

When reviewing my code changes, please focus on:
https://github.com/threerings/playn/compare/showcase

After the review, I'll merge this branch into:
/trunk

Original issue reported on code.google.com by samskiv...@gmail.com on 22 Aug 2011 at 4:50

GoogleCodeExporter commented 9 years ago
I also fixed up the test subprojects: I moved some non-testy code from 
test/core into a Showcase demo, and changed test/core to test/benchmark as it 
now has the single purpose of benchmarking the layers implementation (though 
it's not clear how to interpret the reported data).

I also created the proper four project setup for both of the test subprojects. 
Unfortunately, the test subprojects are not as amenable as the samples to 
unification, so we have to deal with some subproject proliferation there.

Original comment by samskiv...@gmail.com on 22 Aug 2011 at 4:53

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Love it! Snake is reminiscent of the old Win98 screensavers. I threw it on 
appengine while I was playing around: http://playn-showcase-test.appspot.com

Couple of minor setup issues:
I had to run git checkout remotes/origin/showcase to switch to your showcase 
branch after cloning. I also needed to change haltonfailure="yes" to "no" in 
showcase-playn/etc/build-common.xml because the tests were failing 
(intentionally, I believe) which halted the build.

One minor nit: do you mind adding the header preamble to Menu.java and 
SnakeDemo.java?

LGTM otherwise, thank you for the patch and cleanup.

Original comment by pdr@google.com on 23 Aug 2011 at 1:23

GoogleCodeExporter commented 9 years ago
Added headers and committed.

Original comment by samskiv...@gmail.com on 23 Aug 2011 at 5:24