OLPCities/Changing avatares and auto-save: Difference between revisions

From OLPC
Jump to navigation Jump to search
No edit summary
No edit summary
 
(31 intermediate revisions by 2 users not shown)
Line 1: Line 1:
At this last lesson of our tutorials serie we will learn how to make our OLPCity more sophisticated. It will be possible to choice an avatar and, if the kid go out of the OLPCity at some Lot X, when it comes back it will be at the same Lot X
At this last lesson of our tutorials serie we will learn how to make our OLPCity more sophisticated. It will be possible to choice an avatar for all the Lots of an OLPCity and, if the kid go out of the OLPCity at some Lot X, when it comes back it will be at the same Lot X having the same avatar. <b>The kid needs to enter at the OLPCity allways by the same "main address".</b>

[[Image: Tut11-1.jpg | left]]

[[Image: Tut11-1.JPG | left]]Look the figure. The folder having the first Lot of a OLPCity will have a file: index.html.
The code of this page is:








<pre>
<html>
<head>
<script language="Javascript" src="http://www.dmu.com/olpc/gamelib_core.js"></script>
<script language="Javascript" src="http://www.dmu.com/olpc/gamelib_sprites.js"></script>
<script language="Javascript" src="http://www.dmu.com/olpc/gamelib_keyboard.js"></script>
<script language="Javascript" src="http://www.dmu.com/olpc/gamelib_mouse.js"></script>
<script language="Javascript" src="http://www.dmu.com/olpc/gamelib_interface.js"></script>
<script language="Javascript">
function init(){
Sp_linuxcompatible=true;

avatcust = new Gl_cookie("avatx");
if(avatcust.value==null ){
window.location="avatarcust.html" ;
}
else{
pointt = new Gl_cookie("ptt");
if(pointt.value!=null

Latest revision as of 19:07, 30 June 2007

At this last lesson of our tutorials serie we will learn how to make our OLPCity more sophisticated. It will be possible to choice an avatar for all the Lots of an OLPCity and, if the kid go out of the OLPCity at some Lot X, when it comes back it will be at the same Lot X having the same avatar. The kid needs to enter at the OLPCity allways by the same "main address".


Tut11-1.JPG

Look the figure. The folder having the first Lot of a OLPCity will have a file: index.html.

The code of this page is:





<html>
<head>
<script language="Javascript" src="http://www.dmu.com/olpc/gamelib_core.js"></script>
<script language="Javascript" src="http://www.dmu.com/olpc/gamelib_sprites.js"></script>
<script language="Javascript" src="http://www.dmu.com/olpc/gamelib_keyboard.js"></script>
<script language="Javascript" src="http://www.dmu.com/olpc/gamelib_mouse.js"></script>
<script language="Javascript" src="http://www.dmu.com/olpc/gamelib_interface.js"></script>
<script language="Javascript">
 
function init(){
 Sp_linuxcompatible=true;

 avatcust = new Gl_cookie("avatx");
 if(avatcust.value==null  ){
 window.location="avatarcust.html" ;
 }
 else{
  pointt   = new Gl_cookie("ptt");
  if(pointt.value!=null