Difference between revisions of "Activities/Pilas"

From Sugar Labs
Jump to navigation Jump to search
 
(32 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<noinclude>{{Translations | [[Activities/Turtle Art|english]] &#124; [[Activities/Turtle Art/lang-es|español]] &#124;}}
 
<noinclude>{{Translations | [[Activities/Turtle Art|english]] &#124; [[Activities/Turtle Art/lang-es|español]] &#124;}}
 
[[Category:Activities|Turtle Art]]</noinclude>
 
[[Category:Activities|Turtle Art]]</noinclude>
Sorry, information only available low quality translation at the moment. Your help with translation will be very welcome :)
+
This page is based on documents translated from Spanish. Your help improving the translation would be very welcome :)
  
 
[[Activities/Pilas/lang-es|Go to Pilas Activity page in Spanish]].
 
[[Activities/Pilas/lang-es|Go to Pilas Activity page in Spanish]].
  
This is to bring the game development engine pilas-engine to Sugar, adapting to the needs of this platform and adding elements to your learning curve.
+
==About the Pilas.xo Project==
 +
Pilas is an engine for making videogames in an easy way. It's oriented to people that are learning to code videogames and that want to achive interesting and fun result very quickly.
  
We seek to facilitate teaching tool for Python and game development.
+
This project brings the Pilas game development engine to Sugar, adapting it to the needs of the Sugar platform and adding elements to your learning curve. We seek to facilitate a teaching tool for Python and game development.
  
This project was developed during the 2011 Sugar Junin Day
+
This project was developed during [[Sugar Day Junin 2011]]
Links to the project
 
  
* Activity. .XO [1]
+
==Links to the project==
* Code [2]
+
 
* Issues tracker [3]
+
* Pilas: [http://www.pilas-engine.com.ar/]
 +
* Activity.xo [http://activities.sugarlabs.org/sugar/addon/4484]
 +
* Code [https://bitbucket.org/hugoruscitti/pilas]
 +
* Issues tracker [https://bitbucket.org/hugoruscitti/pilas/issues]
 
* Name of branch 'pilasqt'. Command to take to the branch:  
 
* Name of branch 'pilasqt'. Command to take to the branch:  
  
hg clone https://hugoruscitti@bitbucket.org/hugoruscitti/pilas  
+
hg clone https://hugoruscitti@bitbucket.org/hugoruscitti/pilas  
 +
cd pilas/
 +
hg update pilasqt
 +
 
 +
==Getting Started==
 +
The Activity starts with the game engine initialised and a monkey (mono) preloaded. The monkey is displayed in the upper pane and the lower pane executes Python code in immediate mode
 +
 
 +
[[File:Pilas xo.png|center|300px]]
 +
 
 +
The following Pilas commands can be entered :
  
cd pilas/  
+
mono.sonreir()                      //monkey smile
 +
mono.gritar()                        //monkey shout
 +
mono.decir("Hello World!") 
 +
mono.x = 100
 +
mono.y = 100
 +
mono.z = 1                          //depth or drawing order
 +
mono.escala = 2                      //set scale
 +
mono.rotacion = 40                  //rotate 40 degrees
 +
mono.rotacion = [360]                // the [] means animate
 +
mono.x = [-200, 200]                //animate horizontally
 +
mono.x = [-200, 200] * 5            //go side to side 5 times
 +
mono.x = [-200, 200], 10            //animate over 10 seconds
 +
help(mono)
 +
pilas.ver(mono)                      //view source
 +
mono.eliminar()                      //delete monkey
 +
mono = pilas.actores.Mono()          //create a monkey instance
 +
pilas.iniciar()                      //initialise the game engine
 +
pilas.iniciar(gravedad=(0, 0))      //initialise and set gravity
 +
//with pilas.actores you can create:
 +
//Mono Bomba Pingu Pelota Banana      Monkey Bomb Penguin Ball Banana
 +
//Caja Tortuga Moneda Estrella        Box Turtle Money Star
 +
//Nave Piedra                          Plane Rock
 +
pilas.ejemplos.Piezas ()            //starts a demonstration game
  
hg update pilasqt
+
There is much more, read the Spanish documentation. [http://www.pilas-engine.com.ar/]
  
Status
+
==Status==
  
What's done:
+
What has been done:
  
* Packaging the pilas-engine [4] to run on Sugar.
+
* Packaging the pilas-engine [http://www.ninja-ide.org/] to run on Sugar.
* Incorporation of PyQt libraries [5] into the activity
+
* Incorporation of PyQt libraries [http://www.riverbankcomputing.co.uk] into the activity
* Adding widget ninja-ide [6] , to have interactive shell on the same screen.
+
* Adding widget ninja-ide [http://www.ninja-ide.org/] , to have the interactive shell on the same screen.
* Generation of file dependencies needed for the project with PyInstaller [7]
+
* Generation of file dependencies needed for the project with PyInstaller [http://www.pyinstaller.org/]
 
* Creating the pilas.xo activity  
 
* Creating the pilas.xo activity  
  
Line 36: Line 70:
  
 
* Bug: resize widgets
 
* Bug: resize widgets
    * Bug: set focus Bug: set focus
+
* Bug: set focus
    * Documentación de cómo se empaqueta actividad con Qt [8] para Sugar Documentation of how it is packaged with Qt activity [8] for Sugar
+
* Documentation of how it is packaged with Qt activity [http://qt.nokia.com/] for Sugar
    * definir user guidelines y hacer mockups define user guidelines and make mockups
+
* define user guidelines and make mockups
          o ejemplos tipo pippy [9] pippy typical examples [9]
+
* typical Pippy examples [http://activities.sugarlabs.org/sugar/addon/4041]
          o tabs de intérprete y editor de código tabs interpreter and code editor
+
* interpreter and code editor tabs
          o opción para correr en recuadro o fullscreen option to run in fullscreen box or
+
* option to run in fullscreen or box
          o lista de actores de pilas y comportamiento list of actors batteries and behavior
+
* list of Pilas actions and behaviors
          o pestaña de ayuda help tab
+
* help tab
          o opciones de persistencia persistence options  
+
* persistent options  
    * Documentar ejemplos / guía de inicio Document examples / startup guide  
+
* Document examples / startup guide
  
Future Work
+
==Future Work==
  
Hay que convertir esto en un roadmap... We must turn this into a roadmap ...
+
We must turn this into a roadmap ...
  
To-do: To-do:
+
To-do:
 +
* Trim list of dependencies created PyInstaller, to include only what is needed
 +
* Incorporating autocomplete and inline help for the ninja-ide
 +
* Use dbus [http://dbus.freedesktop.org/] to communicate with the menu of others
 +
* Incorporate Sugar persistence [persistence options or code to be developed]
 +
* Integrate code for the pilas-engine [http://www.pilas-engine.com.ar/] and pilas.xo
  
    * Recortar lista de dependencias creada con PyInstaller, que solo incluya lo que hace falta Trim list of dependencies created PyInstaller, that includes only what is needed
+
Wish list
    * Incorporar autocomplete e inline help de ninja-ide Incorporating inline autocomplete and help of ninja-ide
 
    * Utilizar dbus [10] para comunicar widgets del menú con los otros Use dbus [10] to communicate around the menu with the other
 
    * Incorporar persistencia de Sugar [o distintas opciones de persistencia del código que se desarrolle] Incorporate Sugar persistence [persistence options or code to be developed]
 
    * Integrar código de pilas-engine [11] y pilas.xo Embed code for battery-engine [11] and pilas.xo
 
  
Wish list
+
* Refactoring to PyCairo [http://cairographics.org/pycairo/]
 +
* Incorporate into the activity the possibility of Sugar sharing
 +
* Add interactive options on objects (such as in eToys [http://activities.sugarlabs.org/es-ES/sugar/addon/4030] )
 +
 
 +
 
 +
==Running Pilas from Pippy or Terminal==
 +
This is not working, help please!
 +
 
 +
<s>
 +
Pippy:
 +
import sys
 +
sys.path.append('/home/olpc/Activities/Pilas.activity')
 +
import pilas
 +
pilas.iniciar()
 +
 
 +
Terminal:
 +
 
 +
Create a file myprogram.py in ~/Pilas.activity containing
 +
import pilas
 +
pilas.iniciar()
  
    * Refactoring para PyCairo [12] Refactoring to PyCairo [12]
+
In Terminal type
    * Incorporar posibilidad de compartir actividad de Sugar Incorporate activity sharing Sugar
+
python myprogram.py
    * Agregar opciones interactivas sobre los objetos (tipo eToys [13] ) Add interactive features on objects (eToys type [13] )
+
</s>

Latest revision as of 21:09, 21 April 2012

english | español | HowTo [ID# 77589] 

This page is based on documents translated from Spanish. Your help improving the translation would be very welcome :)

Go to Pilas Activity page in Spanish.

About the Pilas.xo Project

Pilas is an engine for making videogames in an easy way. It's oriented to people that are learning to code videogames and that want to achive interesting and fun result very quickly.

This project brings the Pilas game development engine to Sugar, adapting it to the needs of the Sugar platform and adding elements to your learning curve. We seek to facilitate a teaching tool for Python and game development.

This project was developed during Sugar Day Junin 2011

Links to the project

  • Pilas: [1]
  • Activity.xo [2]
  • Code [3]
  • Issues tracker [4]
  • Name of branch 'pilasqt'. Command to take to the branch:
hg clone https://hugoruscitti@bitbucket.org/hugoruscitti/pilas 
cd pilas/ 
hg update pilasqt

Getting Started

The Activity starts with the game engine initialised and a monkey (mono) preloaded. The monkey is displayed in the upper pane and the lower pane executes Python code in immediate mode

Pilas xo.png

The following Pilas commands can be entered :

mono.sonreir()                       //monkey smile
mono.gritar()                        //monkey shout
mono.decir("Hello World!")  
mono.x = 100
mono.y = 100
mono.z = 1                           //depth or drawing order
mono.escala = 2                      //set scale
mono.rotacion = 40                   //rotate 40 degrees
mono.rotacion = [360]                // the [] means animate
mono.x = [-200, 200]                 //animate horizontally
mono.x = [-200, 200] * 5             //go side to side 5 times
mono.x = [-200, 200], 10             //animate over 10 seconds
help(mono)
pilas.ver(mono)                      //view source
mono.eliminar()                      //delete monkey
mono = pilas.actores.Mono()          //create a monkey instance
pilas.iniciar()                      //initialise the game engine
pilas.iniciar(gravedad=(0, 0))       //initialise and set gravity
//with pilas.actores you can create:
//Mono Bomba Pingu Pelota Banana       Monkey Bomb Penguin Ball Banana
//Caja Tortuga Moneda Estrella         Box Turtle Money Star
//Nave Piedra                          Plane Rock
pilas.ejemplos.Piezas ()             //starts a demonstration game

There is much more, read the Spanish documentation. [5]

Status

What has been done:

  • Packaging the pilas-engine [6] to run on Sugar.
  • Incorporation of PyQt libraries [7] into the activity
  • Adding widget ninja-ide [8] , to have the interactive shell on the same screen.
  • Generation of file dependencies needed for the project with PyInstaller [9]
  • Creating the pilas.xo activity

To-do immediately:

  • Bug: resize widgets
  • Bug: set focus
  • Documentation of how it is packaged with Qt activity [10] for Sugar
  • define user guidelines and make mockups
  • typical Pippy examples [11]
  • interpreter and code editor tabs
  • option to run in fullscreen or box
  • list of Pilas actions and behaviors
  • help tab
  • persistent options
  • Document examples / startup guide

Future Work

We must turn this into a roadmap ...

To-do:

  • Trim list of dependencies created PyInstaller, to include only what is needed
  • Incorporating autocomplete and inline help for the ninja-ide
  • Use dbus [12] to communicate with the menu of others
  • Incorporate Sugar persistence [persistence options or code to be developed]
  • Integrate code for the pilas-engine [13] and pilas.xo

Wish list

  • Refactoring to PyCairo [14]
  • Incorporate into the activity the possibility of Sugar sharing
  • Add interactive options on objects (such as in eToys [15] )


Running Pilas from Pippy or Terminal

This is not working, help please!

Pippy:

import sys
sys.path.append('/home/olpc/Activities/Pilas.activity')
import pilas
pilas.iniciar()

Terminal:

Create a file myprogram.py in ~/Pilas.activity containing

import pilas
pilas.iniciar()

In Terminal type

python myprogram.py