PlayN: mudanças entre as edições

De Pontão Nós Digitais
Ir para navegaçãoIr para pesquisar
 
(24 revisões intermediárias por 2 usuários não estão sendo mostradas)
Linha 2: Linha 2:
[[Imagem:Logo-gwt.png|right|bottom|alt=GWT -- Google Web Toolkit]]
[[Imagem:Logo-gwt.png|right|bottom|alt=GWT -- Google Web Toolkit]]


* This is a multi-platform based solution for >= 5 platforms, based on Java and proposed by Google/GWT team.
* PlayN is a multi-platform based solution for N >= 5 platforms, based on Java and proposed by Google/GWT team.
* Home page http://code.google.com/p/playn/wiki/GettingStarted
* Home page http://code.google.com/p/playn/wiki/GettingStarted
* Deployment seems very easy and from our experience it really is!
== Learning ==
== Learning ==
* [[Lab Macambira]] tutorials on PlayN and [[Pet]]:
* [[Lab Macambira]] tutorials on PlayN and [[Pet]]:
Linha 10: Linha 9:
** Part 2  http://youtu.be/Y1fA69EKfRU - generic workflows in PlayN
** Part 2  http://youtu.be/Y1fA69EKfRU - generic workflows in PlayN
** Part 3  http://youtu.be/veCo81CtCqM - our workflows for [[Pet]], a run-through of the code, and [[Git]], Trac, [[AA]].
** Part 3  http://youtu.be/veCo81CtCqM - our workflows for [[Pet]], a run-through of the code, and [[Git]], Trac, [[AA]].
* O basico pra rodar no eclipse: https://youtu.be/Yn_t6E2ztvA
* Basics for working under Eclipse: https://youtu.be/Yn_t6E2ztvA
* The usual guide is very good: http://code.google.com/p/playn/wiki/GettingStarted
* The usual guide is very good: http://code.google.com/p/playn/wiki/GettingStarted
* I had to instal maven 3 from source in ubuntu 11.10
* Look at demos in playn-samples and tripleplay
* Para mudar o tamanho da janela do jogo, tem que editar o backend de cada plataforma para inserir codigo especifico
* Also look at some simple but useful demos at https://code.google.com/p/playn/wiki/DemoLinks
* Look at a standalone Reversi example which usesPlayN + Nexus[https://github.com/threerings/nexus-demos/tree/master/reversi]. Though this lacks a step-by-step tutorial, it is example code for a simple, fully working game.
 
=== Notes on the Actual Learning Path ===
* I had to install maven 3 from source in ubuntu 11.10  
* To change the size of the game window, I had to edit the backend of each platform in order to insert specific code


== Notes ==
== Notes ==
Linha 19: Linha 23:
** It is important to indicate an available GAE SDK (usually behind the official)
** It is important to indicate an available GAE SDK (usually behind the official)
** When following the instructions in http://code.google.com/p/playn/wiki/GettingStarted, it may be necessary to run ''mvn install'' first prior to the  mvn -f html/pom.xml gae:run
** When following the instructions in http://code.google.com/p/playn/wiki/GettingStarted, it may be necessary to run ''mvn install'' first prior to the  mvn -f html/pom.xml gae:run
* Java 7 is required (Java 6 gives compilation errors on OSX Mavericks as of Dec 9 2013)
== Developing PlayN itself / Using latest libs ==
* download playn from git
git clone https://code.google.com/p/playn/
* inside playn type
mvn compile
mvn install
* then repeat this for tripleplay and react (see below)
* to use these development snapshots into your project, make sure to update the playn version in the pom.xml
* you can check that the latest version is available by looking into your local repo like so:
cd ~/.m2
find . -name '*playn*'
* to see what versions of playn are available in the official repositories, search in google for "playn maven repository", then click on the playn-core package to see the available versions. Usually the SNAPSHOT suffix will be reserved for the local git snapshots so they don't conflict with the remote repos.
=== PlayN development repo ===
Currently PlayN development of new features is being heavily done in SEGA Threerings' fork of playn. So in order to run the latest tripleplay and react lib, you'll often have to resort to the master branch of threerings. Do this inside your playn git repository:
git remote add ooo git://github.com/threerings/playn.git
git fetch ooo
git checkout remotes/ooo/master
git checkout -b ooo-master
mvn clean compile
mvn install
Then proceed to recompile and install tripleplay and react, then your game should be using the new stuff.
==== Threerings' Tripleplay ====
git clone git://github.com/threerings/tripleplay.git
cd tripleplay
mvn compile
mvn install
==== Threerings' React ====
git clone git://github.com/threerings/react.git
cd react
mvn compile
mvn install
==Testing==
=== Testing without compiling everything ===
If what you would like to do is to run just the test phase of the lifecycle without running all of the previous phases (eg, compilation of all packages) you could call the goal that is bound to the test phase:
mvn surefire:test
or if you want to run just one test
mvn -Dtest=NameOfTest surefire:test
The above works for my project [[Pet]] on <tt>core</tt> for fast testing, but also on the basedir if you first do an 'mvn install'.
Sometimes I also just go into the toplevel pom.xml file and exclude
under development (experimental) files from the build cycle entirely
        <plugin>
          ...
          <artifactId>maven-compiler-plugin</artifactId>
          ...
          <configuration>
          ...
            <excludes>
              <exclude>**/PetOld.java</exclude>
              <exclude>**/PetWorld.java</exclude>
            </excludes>
          ...
          </configuration>
          ...


=== Trying things out ===
* [http://www.beanshell.org Beanshell java interpreter] is cool for testing ideas / language features out
== Tips ==
* Maven output colorization https://github.com/builddoctor/maven-antsy-color
== See also ==
== See also ==
* [[GT-Games]]: more game development at our lab
* [[GT-Games]]: more game development at our lab
* [[Mac]] article for our setup in Mac OS X
* [[Mac]] article for our setup in Mac OS X
* Community wiki with a number of practical tips [https://github.com/dmg46664/playn/wiki]


[[Category:Lab Macambira]] [[Category:Games]]
[[Category:Lab Macambira]] [[Category:Games]] [[Category:Java]] [[Category:Web]]

Edição atual tal como às 14h58min de 16 de dezembro de 2014

PlayN -- Cross Platform Game Framework originated at Google
GWT -- Google Web Toolkit

Learning

Notes on the Actual Learning Path

  • I had to install maven 3 from source in ubuntu 11.10
  • To change the size of the game window, I had to edit the backend of each platform in order to insert specific code

Notes

  • To deploy to Google app engine (GAE)
    • It is important to indicate an available GAE SDK (usually behind the official)
    • When following the instructions in http://code.google.com/p/playn/wiki/GettingStarted, it may be necessary to run mvn install first prior to the mvn -f html/pom.xml gae:run
  • Java 7 is required (Java 6 gives compilation errors on OSX Mavericks as of Dec 9 2013)

Developing PlayN itself / Using latest libs

  • download playn from git
git clone https://code.google.com/p/playn/
  • inside playn type
mvn compile
mvn install
  • then repeat this for tripleplay and react (see below)
  • to use these development snapshots into your project, make sure to update the playn version in the pom.xml
  • you can check that the latest version is available by looking into your local repo like so:
cd ~/.m2
find . -name '*playn*'
  • to see what versions of playn are available in the official repositories, search in google for "playn maven repository", then click on the playn-core package to see the available versions. Usually the SNAPSHOT suffix will be reserved for the local git snapshots so they don't conflict with the remote repos.

PlayN development repo

Currently PlayN development of new features is being heavily done in SEGA Threerings' fork of playn. So in order to run the latest tripleplay and react lib, you'll often have to resort to the master branch of threerings. Do this inside your playn git repository:

git remote add ooo git://github.com/threerings/playn.git
git fetch ooo
git checkout remotes/ooo/master
git checkout -b ooo-master
mvn clean compile
mvn install

Then proceed to recompile and install tripleplay and react, then your game should be using the new stuff.

Threerings' Tripleplay

git clone git://github.com/threerings/tripleplay.git
cd tripleplay
mvn compile
mvn install

Threerings' React

git clone git://github.com/threerings/react.git
cd react
mvn compile
mvn install

Testing

Testing without compiling everything

If what you would like to do is to run just the test phase of the lifecycle without running all of the previous phases (eg, compilation of all packages) you could call the goal that is bound to the test phase:

mvn surefire:test

or if you want to run just one test

mvn -Dtest=NameOfTest surefire:test

The above works for my project Pet on core for fast testing, but also on the basedir if you first do an 'mvn install'.

Sometimes I also just go into the toplevel pom.xml file and exclude under development (experimental) files from the build cycle entirely

       <plugin>
         ...
         <artifactId>maven-compiler-plugin</artifactId>
         ...
         <configuration>
         ...
            <excludes>
             <exclude>**/PetOld.java</exclude>
             <exclude>**/PetWorld.java</exclude>
           </excludes>
         ...
         </configuration>
         ...

Trying things out

Tips

See also

  • GT-Games: more game development at our lab
  • Mac article for our setup in Mac OS X
  • Community wiki with a number of practical tips [2]