(20140720)

This commit is contained in:
2014-07-20 00:00:00 +02:00
parent 29548c6fe0
commit 0e624cec1c
89 changed files with 10848 additions and 203 deletions

BIN
DIST/web/game.data Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 476 KiB

95
DIST/web/game.html Normal file
View File

@@ -0,0 +1,95 @@
<!doctype html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Emscripten-Generated Code</title>
<style>
.emscripten { padding-right: 0; margin-left: auto; margin-right: auto; display: block; }
textarea.emscripten { font-family: monospace; width: 80%; }
div.emscripten { text-align: center; }
div.emscripten_border { border: 1px solid black; }
/* the canvas *must not* have any border or padding, or mouse coords will be wrong */
canvas.emscripten { border: 0px none; }
</style>
</head>
<body>
<hr/>
<div class="emscripten" id="status">Downloading...</div>
<div class="emscripten">
<progress value="0" max="100" id="progress" hidden=1></progress>
</div>
<div class="emscripten_border">
<canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()"></canvas>
</div>
<hr/>
<div class="emscripten">
<input type="checkbox" id="resize">Resize canvas
<input type="checkbox" id="pointerLock" checked>Lock/hide mouse pointer
&nbsp;&nbsp;&nbsp;
<input type="button" value="Fullscreen" onclick="Module.requestFullScreen(document.getElementById('pointerLock').checked,
document.getElementById('resize').checked)">
</div>
<hr/>
<textarea class="emscripten" id="output" rows="8"></textarea>
<hr>
<script type='text/javascript'>
// connect to canvas
var Module = {
preRun: [],
postRun: [],
print: (function() {
var element = document.getElementById('output');
element.value = ''; // clear browser cache
return function(text) {
text = Array.prototype.slice.call(arguments).join(' ');
// These replacements are necessary if you render to raw HTML
//text = text.replace(/&/g, "&amp;");
//text = text.replace(/</g, "&lt;");
//text = text.replace(/>/g, "&gt;");
//text = text.replace('\n', '<br>', 'g');
element.value += text + "\n";
element.scrollTop = 99999; // focus on bottom
};
})(),
printErr: function(text) {
text = Array.prototype.slice.call(arguments).join(' ');
if (0) { // XXX disabled for safety typeof dump == 'function') {
dump(text + '\n'); // fast, straight to the real console
} else {
console.log(text);
}
},
canvas: document.getElementById('canvas'),
setStatus: function(text) {
if (!Module.setStatus.last) Module.setStatus.last = { time: Date.now(), text: '' };
if (text === Module.setStatus.text) return;
var m = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/);
var now = Date.now();
if (m && now - Date.now() < 30) return; // if this is a progress update, skip it if too soon
var statusElement = document.getElementById('status');
var progressElement = document.getElementById('progress');
if (m) {
text = m[1];
progressElement.value = parseInt(m[2])*100;
progressElement.max = parseInt(m[4])*100;
progressElement.hidden = false;
} else {
progressElement.value = null;
progressElement.max = null;
progressElement.hidden = true;
}
statusElement.innerHTML = text;
},
totalDependencies: 0,
monitorRunDependencies: function(left) {
this.totalDependencies = Math.max(this.totalDependencies, left);
Module.setStatus(left ? 'Preparing... (' + (this.totalDependencies-left) + '/' + this.totalDependencies + ')' : 'All downloads complete.');
}
};
Module.setStatus('Downloading...');
</script>
<script async type="text/javascript" src="game.js"></script>
</body>
</html>

9000
DIST/web/game.js Normal file

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 723 B

BIN
DIST/web/imgview/fondo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

View File

@@ -0,0 +1,71 @@
/***********************************************
* Copyright (c) 2010 Valeriano Alfonso *
***********************************************/
/*
NOTA DE DOMINIO PUBLICO
-----------------------
ImgView es Dominio Publico. Esto significa que se puede hacer con el
lo que se quiera sin haber ninguna garantia de reembolso o idoneidad.
Se aprecia que la fuente sea citada.
*/
#imgview_fondo {
background-image: url(fondo.png);
}
#imgview_imgcargando {
border: 10px solid white;
}
#imgview_fondo a {
padding:0px;
margin:0px;
}
#imgview {
background-color: white;
border: 10px solid white;
}
#imgview img {
border: none;
padding:0px;
margin:0px;
}
#imgview a {
padding:0px;
margin:0px;
}
#imgview_control {
height: 30px;
background-color: white;
}
#imgview_anterior {
background-color: white;
float: left;
width: 50%;
height:32px;
border:0px;
padding:0px;
margin:0px;
background-image:url('anterior.png');
background-repeat:no-repeat;
background-position: 50% 0%;
cursor:pointer;
}
#imgview_siguiente {
background-color: white;
float: right;
width: 50%;
height:32px;
border:0px;
padding:0px;
margin:0px;
background-image:url('siguiente.png');
background-repeat:no-repeat;
background-position: 50% 0%;
cursor:pointer;
}

497
DIST/web/imgview/imgview.js Normal file
View File

@@ -0,0 +1,497 @@
/***********************************************
* Copyright (c) 2010 Valeriano Alfonso *
***********************************************/
/*
NOTA DE DOMINIO PUBLICO
-----------------------
ImgView es Dominio Publico. Esto significa que se puede hacer con el
lo que se quiera sin haber ninguna garantia de reembolso o idoneidad.
Se aprecia que la fuente sea citada.
*/
/*
Historial de cambios
--------------------
1.0 2010-1-3 :
* Version inicial.
1.1 2010-1-5 :
* Corregida necesidad de cargar el script en la seccion head.
* Funcionalidad basica de album implementada.
1.2 2010-5-18 :
* Asimilado de todos los enlaces a imagenes en un album general.
* Iconos de anterior y siguiente de los albums, nuevos.
*/
/////////////////////////
// Configuracion
//
var imgview_prefix = ""; // Se atoconfigura
var imgview_border = 10; // Tambien ajustar en el CSS.
var imgview_control_alto = 32; // Tambien ajustar en el CSS.
///////////////////////
// Globales
//
var imgview_nombre_album="";
var imgview_href_anterior="";
var imgview_href_siguiente="";
var imgview_preloader=false;
/////////////////////////////////////
// ImgView_ShowImage
//
function ImgView_ShowImage(href,is_album){
var elemFondo = document.getElementById('imgview_fondo');
var elemImgview = document.getElementById('imgview');
var elemImgviewControl = document.getElementById('imgview_control');
var elemImgCargando = document.getElementById('imgview_imgcargando');
var elemEnlace = document.getElementById('imgview_enlace');
var elemImg = document.getElementById('imgview_img');
var elemAnt = document.getElementById('imgview_anterior');
var elemSig = document.getElementById('imgview_siguiente');
var preloader;
var max_horiz, max_vert;
var ventana_ancho, ventana_alto;
var pagina_ancho, pagina_alto;
var pos_horiz = 0, pos_vert = 0;
if(is_album){
var enlaces;
var imgview_RegExp;
var nombre_temp;
var i,j;
// Buscar imagenes anterior y siguientes
enlaces = document.getElementsByTagName("a");
for(i=0;i<enlaces.length;i++){
if(enlaces[i].getAttribute("href")==href &&
enlaces[i].getAttribute("imgview_albumid")==imgview_nombre_album)
{
// Encontrado el actual
// Buscar Anterior
imgview_href_anterior="";
if(i>0){
j=i-1;
while(j>=0){
if(enlaces[j].getAttribute("imgview_albumid")==
imgview_nombre_album)
{
imgview_href_anterior=enlaces[j].getAttribute("href");
break;
}
j--;
}
}
// Buscar Siguiente
imgview_href_siguiente="";
if(i<(enlaces.length-1)){
j=i+1;
while(j<enlaces.length){
if(enlaces[j].getAttribute("imgview_albumid")==
imgview_nombre_album)
{
imgview_href_siguiente=enlaces[j].getAttribute("href");
break;
}
j++;
}
}
}
}
}
// Obtener maximos de scroll
if(window.innerHeight && window.scrollMaxY) {
max_horiz = document.body.scrollWidth;
max_vert = window.innerHeight + window.scrollMaxY;
}else if(document.body.scrollHeight > document.body.offsetHeight){
// all but Explorer Mac
max_horiz = document.body.scrollWidth;
max_vert = document.body.scrollHeight;
}else{
// Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
max_horiz = document.body.offsetWidth;
max_vert = document.body.offsetHeight;
}
// Obtener tamanho de la ventana
if(window.innerHeight) {
// Todos excepto Explorer
ventana_ancho = window.innerWidth;
ventana_alto = window.innerHeight;
}else if(document.documentElement && document.documentElement.clientHeight){
// Explorer 6 Strict
ventana_ancho = document.documentElement.clientWidth;
ventana_alto = document.documentElement.clientHeight;
}else if(document.body){
// Resto de Explorers
ventana_ancho = document.body.clientWidth;
ventana_alto = document.body.clientHeight;
}
// HACK: reducir el tamaho de ventana_ancho. Hace que no sobrepase los bordes
ventana_ancho-=20;
// Obtener el tamanho de la pagina
if(max_vert < ventana_alto){
pagina_alto = ventana_alto;
}else{
pagina_alto = max_vert;
}
if(max_horiz < ventana_ancho){
pagina_ancho = ventana_ancho;
}else{
pagina_ancho = max_horiz;
}
// Obtener posicion del los scrolls
if( typeof( window.pageYOffset ) == 'number' ) {
// La mayoria de navegadores
pos_vert = window.pageYOffset;
pos_horiz = window.pageXOffset;
} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
// Explorer
pos_vert = document.body.scrollTop;
pos_horiz = document.body.scrollLeft;
} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
// Explorer 6 Strict
pos_vert = document.documentElement.scrollTop;
pos_horiz = document.documentElement.scrollLeft;
}
// Centrar y hacer visible la imagen de cargando
if(elemImgCargando){
elemImgCargando.style.top =
(pos_vert +
((ventana_alto - elemImgCargando.height) / 2)) + 'px';
elemImgCargando.style.left =
(pos_horiz +
((ventana_ancho - elemImgCargando.width) / 2)) + 'px';
elemImgCargando.style.display = 'block';
}
// Hacer que el fondo ocupe la pagina y sea visible
elemFondo.style.height = (pagina_alto + 'px');
elemFondo.style.display = 'block';
// Carga de la imagen
imgview_preloader=new Image();
imgview_preloader.onload=function(){
// Mostrar imgview, necesario para que los tamanhos sean correctos
elemImgview.style.display = 'block';
// Mostrar/Ocultar control de albums
if(is_album){
elemImgviewControl.style.display = 'block';
ventana_alto-=imgview_control_alto;
if(imgview_href_anterior.length==0){
elemAnt.style.display = 'none';
}else{
elemAnt.style.display = 'block';
}
if(imgview_href_siguiente.length==0){
elemSig.style.display = 'none';
}else{
elemSig.style.display = 'block';
}
}else{
elemImgviewControl.style.display = 'none';
}
// Establecer la imagen precargada
elemImg.src = href;
elemImg.width = imgview_preloader.width;
elemImg.height = imgview_preloader.height;
// Ajustar el tamanho de la imagen
var relacion=elemImg.width/elemImg.height;
if((elemImg.height+imgview_border*2)>ventana_alto){
elemImg.height=ventana_alto-imgview_border*2;
elemImg.width=elemImg.height*relacion;
}
if((elemImg.width+imgview_border*2)>ventana_ancho){
elemImg.width=ventana_ancho-imgview_border*2;
elemImg.height=elemImg.width/relacion;
}
// Centrar imgview
elemImgview.style.top =
(pos_vert +
((ventana_alto - elemImg.height) / 2) - imgview_border) + 'px';
elemImgview.style.left =
(pos_horiz +
((ventana_ancho - elemImg.width) / 2) - imgview_border) + 'px';
// Oclultar imagen de cargar y mostrar imgview
if(elemImgCargando) {
elemImgCargando.style.display = 'none';
}
return false;
}
imgview_preloader.src = href;
elemEnlace.href = href;
}
/////////////////////////////////////
// ImgView_Show
//
function ImgView_Show(obj){
imgview_nombre_album=obj.getAttribute("imgview_albumid");
if(imgview_nombre_album){
ImgView_ShowImage(obj.getAttribute("href"),true);
}else{
ImgView_ShowImage(obj.getAttribute("href"),false);
}
}
/////////////////////////////////////
// ImgView_Hide
//
function ImgView_Hide(){
var elemFondo = document.getElementById('imgview_fondo');
var elemImgview = document.getElementById('imgview');
var elemImgCargando = document.getElementById('imgview_imgcargando');
var elemEnlace = document.getElementById('imgview_enlace');
elemFondo.style.display = 'none';
elemImgview.style.display = 'none';
elemImgCargando.style.display = 'none';
imgview_preloader.onload=function(){return false;}
imgview_preloader.src = "";
elemEnlace.href = "";
}
/////////////////////////////////////
// ImgView_ShowAnterior
//
function ImgView_ShowAnterior(obj){
if(imgview_href_anterior.length){
ImgView_ShowImage(imgview_href_anterior,true);
}
}
/////////////////////////////////////
// ImgView_ShowSiguiente
//
function ImgView_ShowSiguiente(obj){
if(imgview_href_siguiente.length){
ImgView_ShowImage(imgview_href_siguiente,true);
}
}
/////////////////////////////////////
// ImgView_Init
//
// Asociar al evento "onclick" la funcion "ImgView_Show" a los links con rel="imgview".
// Anhadir el markup necesario para mostrar imagenes.
function ImgView_Init(){
var i;
var enlaces;
var scripts;
var imgview_RegExp;
var isimage_RegExp;
if (!document.getElementsByTagName){
return;
}
// HACK: Obtener el path donde de este mismo script
scripts=document.getElementsByTagName("script");
imgview_RegExp = /imgview\.js$/i;
for(i=0;i<scripts.length;i++){
if(imgview_RegExp.test(scripts[i].getAttribute("src"))){
imgview_prefix=scripts[i].getAttribute("src").
replace(imgview_RegExp,"");
}
}
if(imgview_prefix.length<1){
imgview_prefix=".";
}
// Iterar los enlaces
enlaces = document.getElementsByTagName("a");
imgview_RegExp = /^imgview\./i;
isimage_RegExp = /\.gif$|\.jpg$|\.jpeg$|\.png$/i;
for(i=0;i<enlaces.length;i++){
link_href=enlaces[i].getAttribute("href");
if(link_href && isimage_RegExp.test(link_href)){
link_rel = enlaces[i].getAttribute("rel")
// Enlace a imagen
if(link_rel == "imgview"){
// Imagen Normal
enlaces[i].onclick =
function () {
ImgView_Show(this);
return false;
}
}else{
if(imgview_RegExp.test(link_rel)){
// Imagen de Album
nombre_album=link_rel.replace(imgview_RegExp,"");
enlaces[i].setAttribute("imgview_albumid",nombre_album);
enlaces[i].onclick =
function () {
ImgView_Show(this);
return false;
}
}else{
// Anhadir en el album global
enlaces[i].setAttribute("imgview_albumid","imgview");
enlaces[i].onclick =
function () {
ImgView_Show(this);
return false;
}
}
}
}
}
// Inyectar el link de la hoja de estilo
var LinkHoja=document.createElement('link');
LinkHoja.rel="stylesheet";
LinkHoja.type="text/css";
LinkHoja.href=imgview_prefix+"/imgview.css";
document.getElementsByTagName("head")[0].appendChild(LinkHoja);
var elemCuerpo = document.body;
// Inyectar markup del fondo con la animacion de carga
var elemFondo = document.createElement("div");
elemFondo.setAttribute('id','imgview_fondo');
elemFondo.onclick =
function () {
ImgView_Hide();
return false;
}
elemFondo.style.display = 'none';
elemFondo.style.position = 'absolute';
elemFondo.style.top = '0';
elemFondo.style.left = '0';
elemFondo.style.zIndex = '90';
elemFondo.style.width = '100%';
elemCuerpo.insertBefore(elemFondo, elemCuerpo.firstChild);
var elemImgCargando = document.createElement("img");
elemImgCargando.src = imgview_prefix+"/cargando.gif";
elemImgCargando.setAttribute('id','imgview_imgcargando');
elemImgCargando.style.position = 'absolute';
elemImgCargando.style.zIndex = '150';
elemImgCargando.style.display = 'none';
elemImgCargando.onclick =
function () {
ImgView_Hide();
return false;
}
elemCuerpo.insertBefore(elemImgCargando, elemCuerpo.firstChild);
// Inyectar markup de imgview
var elemImgview = document.createElement("div");
elemImgview.setAttribute('id','imgview');
elemImgview.style.display = 'none';
elemImgview.style.position = 'absolute';
elemImgview.style.zIndex = '100';
elemCuerpo.insertBefore(elemImgview, elemFondo.nextSibling);
var elemEnlace = document.createElement("a");
elemEnlace.setAttribute('href','#');
elemEnlace.setAttribute('id','imgview_enlace');
elemEnlace.setAttribute('title','Click para cerrar');
elemEnlace.onclick =
function () {
ImgView_Hide();
return false;
}
elemImgview.appendChild(elemEnlace);
var elemImg = document.createElement("img");
elemImg.setAttribute('id','imgview_img');
elemEnlace.appendChild(elemImg);
var elemImgviewControl = document.createElement("div");
elemImgviewControl.setAttribute('id','imgview_control');
elemImgviewControl.style.display = 'none';
elemImgview.appendChild(elemImgviewControl);
var elemImgviewAnterior = document.createElement("div");
elemImgviewAnterior.setAttribute('id','imgview_anterior');
elemImgviewControl.appendChild(elemImgviewAnterior);
elemImgviewAnterior.onclick =
function () {
ImgView_ShowAnterior(this);
return false;
}
var elemImgviewSiguiente = document.createElement("div");
elemImgviewSiguiente.setAttribute('id','imgview_siguiente');
elemImgviewControl.appendChild(elemImgviewSiguiente);
elemImgviewSiguiente.onclick =
function () {
ImgView_ShowSiguiente(this);
return false;
}
// Deshabilitar seleccion de la imagen
elemImgview.onselectstart=function () {return false;}
elemImgview.style.MozUserSelect="none";
elemImg.onselectstart=function () {return false;}
elemImgview.style.MozUserSelect="none";
}
// Asociar la funcion de inciado al evento "onload"
// sin evitar la ejecucion de lo que pudiera estar antes
var imgview_oldonload = window.onload;
if (typeof(imgview_oldonload)!='function'){
window.onload = ImgView_Init;
}else{
window.onload = function(){
imgview_oldonload();
ImgView_Init();
}
}

View File

@@ -0,0 +1,67 @@
-----------------
---- ImgView ----
-----------------
Informacion:
------------
ImgView es un visor de imagenes escrito en Javascript, diseñado para no
entorpecer la navegacion de los usuarios.
Caracteristicas:
----------------
* Apertura de las imagenes en la propia pagina.
* Fundido a negro del resto de la pagina.
* Ajuste del tamaño de las imagenes para que no se salgan de la ventana.
* Conserva la direccion del enlace original.
* Sale clickando en cualquier sitio.
* Soporte para albumes de fotos.
* Asimilacion de todos los enlaces a imagenes por defecto.
Historial:
----------
1.0 2010-1-3 :
* Version inicial.
1.1 2010-1-5 :
* Corregida necesidad de cargar el script en la seccion head.
* Funcionalidad basica de album implementada.
1.2 2010-5-18 :
* Asimilado de todos los enlaces a imagenes en un album general.
* Iconos de anterior y siguiente de los albums, nuevos.
* Ocultado de iconos de anterior siguiente al principio y al
final del album respectivamente.
Instalacion:
------------
Descomprimir en algun directorio accesible al exterior mediante el servidor web.
Uso:
----
Para usarlo hay que cargar el script "imgview.js" en las paginas
donde quiera ser usado:
<script type="text/javascript" src="imgview/imgview.js"></script>
Con esto todos los enlaces a imagenes usaran imgview. Es recomendable
insertar una imagen en miniatura dentro del enlace.
Uso Avanzado:
-------------
Para mostrar una imagen independiente de cualquier album:
<a href="imagen.jpg" rel="imgview"><img src="thumb.jpg"></a>
Para crear albumes independientes; poner a todas las imagenes del mismo grupo
rel="imgview.album", siendo "album" el nombre para esa coleccion:
<a href="imagen1.jpg" rel="imgview.album"><img src="thumb1.jpg"></a>
<a href="imagen2.jpg" rel="imgview.album"><img src="thumb2.jpg"></a>
Licencia:
---------
ImgView es Dominio Publico. Esto significa que se puede hacer con el
lo que se quiera sin haber ninguna garantia de reembolso o idoneidad.
Se aprecia que la fuente sea citada.
Copyright (c) 2010 Valeriano Alfonso

Binary file not shown.

After

Width:  |  Height:  |  Size: 1003 B

104
DIST/web/index.html Normal file
View File

@@ -0,0 +1,104 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" >
<meta name="author" content="Valeriano Alfonso" >
<meta name="description" content="Lonely Ruins" >
<meta name="keywords" content="linux windows game lonely ruins robot kitten">
<meta name="Copyright" content="Copyright (c) 2011-2012 by Valeriano Alfonso, All Right Reserved">
<meta content="ALL" name="ROBOTS">
<link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript" src="imgview/imgview.js"></script>
<title>Lonely Ruins</title>
</head>
<body>
<div class="contenedor">
<table border="0" cellspacing="0" cellpadding="0" align="center">
<tr><td>
<div class="cabecera">
<a class="titulo" href="./"><!-- LOGO--><img src="imagenes/logo_lonelyruins_web.png"></a>
<div class="navbar">
<!-- NAVBAR-->
<div class="menu">
<ul>
<li><a href="#about">About</a></li>
<li><a href="#play">Play</a></li>
<li><a href="#screenshots">Screenshots</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</div>
</div>
</div>
<div class="contenido">
<!-- CONTENIDO -->
<!--ABOUT-->
<a name="about"></a>
<h1>About</h1>
You are a robot on a rescue mision.<br>
The rescuer and the rescued are alone<br>
in a strange place.<br>
<br>
Good Luck!<br>
<p>&nbsp;</p>
<!--PLAY-->
<a name="play"></a>
<h1>Play</h1>
<div class="columnContainer">
<div class="column2" style="text-align: center;">
<a href="play.html" class="playLink">&#9658; Play</a>
</div>
<div class="column2" style="text-align: center;">
<a href="https://play.google.com/store/apps/details?id=com.var.lonelyruins"><img alt="Get it on Google Play" src="https://developer.android.com/images/brand/en_generic_rgb_wo_45.png"></a>
</div>
</div>
<p>&nbsp;</p>
<!--SCREENSHOTS-->
<a name="screenshots"></a>
<h1>Screenshots</h1>
<p>
<span style="vertical-align:top;">
<a href="sshots/20120102/shot-20120102-1.png" rel="imgview.lonelyruins"><img src="sshots/20120102/shot-20120102-1.thumb.png"></a>
<a href="sshots/20120102/shot-20120102-2.png" rel="imgview.lonelyruins"><img src="sshots/20120102/shot-20120102-2.thumb.png"></a>
<a href="sshots/20120102/shot-20120102-3.png" rel="imgview.lonelyruins"><img src="sshots/20120102/shot-20120102-3.thumb.png"></a>
</span>
</p>
<p>&nbsp;</p>
<!--CONTACT-->
<a name="contact"></a>
<h1>Contact</h1>
<ul>
<li><a href="http://varstudio.com">VAR Studio (Main site in spanish).</a></li>
</ul>
<p>&nbsp;</p>
<div class="toTop"><a href="#top">Back to top.</a></div>
<p>&nbsp;</p>
<!-- PIE -->
<div class="pie">
<b>Copyright &copy; 2011-2014 <a href="/">Valeriano Alfonso</a>.</b>
</div>
</div>
</td></tr>
</table>
</div>
</body>
</html>

36
DIST/web/join.php Normal file
View File

@@ -0,0 +1,36 @@
<?php
// split -b 1024 -a 4 -d game.js game.js
$filelist=array();
$fileout="game.js";
for($i=0;$i<564;$i++){
$filelist[]=sprintf("game.js%04d",$i);
}
// Quitar el limite de tiempo
set_time_limit(0);
// Fusionar ficheros
$out=fopen($fileout,"wb") or die("error creating/opening merged file");
foreach($filelist as $file){
$size=filesize($file);
$in=fopen($file,"rb") or die("error opening file");
$data=fread($in, $size) or die("error reading file");
fclose($in);
fwrite($out,$data,$size) or die("error writing to merged file");
}
fclose($out);
// Limpiar
foreach($filelist as $file){
unlink($file);
}
unlink("join.php");
?>
<html>
<body>
<h1>OK!</h1>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

133
DIST/web/play.html Normal file
View File

@@ -0,0 +1,133 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Lonely Ruins</title>
</head>
<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
font-family: Verdana,Arial,Helvetica,sans-serif;
background-color:#000000;
color: #777777;
font-size: 10pt;
}
h1{
text-align: left;
margin-top: 0;
margin-bottom: 1em;
font-size: 16pt;
font-weight: bold;
}
.header{
margin:0 auto;
width:600px;
padding-top:10px;
text-align:center;
}
.progress-container{
border: 1px solid #808080;
border-radius: 5px;
padding: 5px;
box-shadow: 0px 0px 5px #808080;
}
.progress-container progress{
width:100%;
}
.game-screen-container{
margin:0 auto;
width:640px;
padding-top:10px;
}
.game-screen-container canvas{
border: 1px solid #808080;
border-radius: 5px;
padding: 5px;
box-shadow: 0px 0px 5px #808080;
}
</style>
<body>
<div class="header">
<a class="titulo" href="./"><img
src="imagenes/logo_lonelyruins_web_mini.png"></a>
</div>
<div class="game-screen-container">
<div id="progress-container" class="progress-container">
<h1>Loading...</h1>
<span>Code:</span></br>
<progress id="progress-code" max="1" value="0"></progress></br>
</br>
<span>Data:</span></br>
<progress id="progress-data" max="1" value="0"></progress></br>
</div>
<canvas class="game-screen" id="canvas" style="display:none;"
oncontextmenu="event.preventDefault()"></canvas>
</div>
<script type='text/javascript'>
var Module = {
preRun: [function (){
FS.mkdir('/saves');
FS.mount(IDBFS, {}, '/saves');
addRunDependency("SaveDir");
FS.syncfs(true, function (err) {
removeRunDependency("SaveDir");
});
}],
postRun: [],
canvas: document.getElementById('canvas'),
progressContainer: document.getElementById('progress-container'),
progressCode: document.getElementById('progress-code'),
progressData: document.getElementById('progress-data'),
print: function(text) {
if(console && console.log){
console.log(text);
}
},
printErr: function(text) {
this.print(text);
},
setStatus: function(text) {
this.print(text);
var m = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/);
if(m){
this.progressData.value = parseInt(m[2]);
this.progressData.max = parseInt(m[4]);
}
},
totalDependencies: 0,
monitorRunDependencies: function(left) {
this.totalDependencies = Math.max(this.totalDependencies, left);
if(!left){
// All loaded
this.progressContainer.style.display="none";
this.canvas.style.display="block";
}
},
LaunchCode: function (){
var xhr = new XMLHttpRequest();
xhr.open('GET', "game.js", true);
xhr.responseType = 'text';
xhr.onprogress = function(event) {
this.progressCode.value = event.loaded;
this.progressCode.max = event.total;
}.bind(this);
xhr.onload = function(event) {
var packageData = xhr.response;
// Launch loaded code
eval.call(null,packageData);
};
xhr.onerror = function(event) {
alert(event);
};
xhr.send(null);
}
};
Module.LaunchCode();
</script>
<!-- <script async type="text/javascript" src="game.js"></script> -->
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

223
DIST/web/style.css Normal file
View File

@@ -0,0 +1,223 @@
/***********************************************
* Copyright (c) 2012 Valeriano Alfonso *
***********************************************/
/* Elementos Base */
html, body {
height: 100%;
margin: 0;
padding: 0;
font-family: Verdana,Arial,Helvetica,sans-serif;
background-color:#000000;
color: #777777;
font-size: 10pt;
}
h1{
text-align: left;
margin-top: 0;
margin-bottom: 1em;
font-size: 16pt;
font-weight: bold;
}
h2{
text-align: left;
margin-top: 0;
margin-bottom: 0.75em;
font-size: 14pt;
font-weight: bold;
}
h3{
text-align: left;
margin-top: 0;
margin-bottom: 0.5em;
font-size: 10pt;
font-weight: bold;
}
h4{
margin-top: 0;
margin-bottom: 0.5em;
font-size: 11pt;
font-weight: bold;
}
p,li,td{
margin-top: 0;
margin-bottom: 0.5em;
font-size: 10pt;
}
li {
padding:2px;
}
img {
border:0;
}
/* Links normales */
a {
text-decoration:none;
font-weight: bold;
display:inline;
}
a:link {
color: #7777FF;
}
a:visited {
color: #7777FF;
}
a:hover {
color: #FFFFFF;
text-decoration: underline;
}
a:active {
color: #CBB545;
}
/* Estilo de Lonely Ruins */
.contenedor {
margin: 0;
padding: 0;
float: left;
width: 100%;
min-height: 100%;
}
.cabecera {
width: 700px;
height:130px;
margin: 0 auto;
position: relative;
}
.titulo {
margin:0;
padding:0;
border:0;
vertical-align:bottom;
position:absolute;
}
a.titulo:hover {
background:none;
}
a.titulo img {
border:none;
}
a.titulo:hover img{
border:none;
}
.contenido {
width: 700px;
margin:0;
padding:0;
border:0;
position:relative;
margin: 0 auto;
vertical-align:bottom;
}
.pie {
width:700px;
height: 64px;
margin:0;
padding:0;
border:0;
position:relative;
margin: 0 auto;
font-weight: bold;
}
.navbar {
height:130px;
width:500px;
margin:0;
padding:0;
border:0;
vertical-align:bottom;
position:absolute;
bottom:0px;
right:0px;
}
.navbar ul {
list-style:none;
list-style-type:none;
list-style-position:inside;
border:0;
padding:0;
margin:0;
display:block;
position:absolute;
bottom:0;
right:0;
}
.navbar li{
padding:0px;
float: left;
text-align: center;
vertical-align: bottom;
margin: 1px;
border-left:1px solid #777777;
}
.navbar li:first-child{
border-left:none;
}
/* links del navbar */
.navbar a {
padding: 4px;
font-size:12pt;
display:block;
}
.toTop{
text-align:right;
font-size:7pt;
}
.columnContainer{
white-space: nowrap;
font-size: 0;
vertical-align: top;
}
.column2{
width:50%;
display:inline-block;
font-size: 10pt;
vertical-align:top;
}
.playLink{
font-size:25px;
display: inline-block;
border-radius: 10px;
border: solid 1px grey;
width:127px;
height:43px;
line-height:43px;
}
.playLink:link{
color: #777777;
}
.playLink:hover{
box-shadow: 0 0 5px white;
text-shadow: 0 0 2px white;
border: solid 1px white;
text-decoration:none;
color: white;
}

BIN
DIST/web/web_thumb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@@ -83,6 +83,9 @@ extern int game_level;
extern int game_level_point;
extern int game_level_reset;
void LoadGame();
void SaveGame();
void player_proc(Entity e,int ft){
vec2 vel;
@@ -123,25 +126,11 @@ void player_proc(Entity e,int ft){
}
}
vec2_scale(vel,vel,1);
Entity_AddVelLimit(e,vel,3.0f);
vec2_scale(vel,vel,7);
Entity_AddVelLimit(e,vel,15.0f);
}
// Scroll View
GameLib_GetPos(pos);
GameLib_GetSize(size);
size[0]/=2;
size[1]/=2;
pos[0]+=size[0];
pos[1]+=size[1];
delta[0]=e->pos[0]-pos[0];
delta[1]=e->pos[1]-pos[1];
pos[0]-=size[0];
pos[1]-=size[1];
pos[0]=pos[0]+delta[0]/10;
pos[1]=pos[1]+delta[1]/10;
GameLib_SetPos(pos);
GameLib_MoveToPos(e->pos,0.3f);
}
int player_collision(Entity e1,Entity e2,float t,vec2 n){
@@ -151,14 +140,11 @@ int player_collision(Entity e1,Entity e2,float t,vec2 n){
vlen=sqrtf(vec2_dot(e1->vel,e1->vel));
if(vlen>0.0f){
vec2_scale(vdir,e1->vel,1.0f/vlen);
if(vec2_dot(vdir,n)>0.9){
Entity_CollisionResponseCircle(e1,e2,t,vdir);
if (vec2_dot(vdir,n) < -0.9f) {
vec2_orthogonalize4(n);
Entity_CollisionResponseCircle(e2,e1,t,n);
return(2);
}else{
return(1);
}
}else{
return(1);
}
}
return(1);
@@ -188,21 +174,25 @@ void hole_spiked_overlap(Entity e1,Entity e2){
// Disable future overlaps
e1->overlap=NULL;
// Remove the two entities
GameLib_DelEntity(e1);
GameLib_DelEntity(e2);
// "Fill the hole"
e=Entity_Copy(ent_hole_filled);
vec2_copy(e->pos,e1->pos);
GameLib_AddEntity(e);
GameLib_PlaySound(snd_fillhole,(int)e2->pos[0],(int)e2->pos[1]);
// Remove the two entities
GameLib_DelEntity(e1);
GameLib_DelEntity(e2);
}
if(e2->type==Ent_Player){
// "Kill the player"
// Broken player
e=Entity_Copy(ent_player_broken);
vec2_copy(e->pos,e2->pos);
GameLib_AddEntity(e);
GameLib_PlaySound(snd_burn,(int)e2->pos[0],(int)e2->pos[1]);
GameLib_DelEntity(e2);
@@ -212,25 +202,40 @@ void hole_spiked_overlap(Entity e1,Entity e2){
}
void hole_lava_oncopy(Entity ent){
AnimPlay_IncTime(&ent->anim,rand()%1000);
}
void hole_lava_overlap(Entity e1,Entity e2){
Entity e;
if(e2->type==Ent_Barrel){
// "Burn the barrel"
GameLib_DelEntity(e2);
// Make fire
e=Entity_Copy(ent_fire);
vec2_copy(e->pos,e2->pos);
GameLib_AddEntity(e);
GameLib_PlaySound(snd_burn,(int)e2->pos[0],(int)e2->pos[1]);
GameLib_DelEntity(e2);
}
if(e2->type==Ent_Player){
// "Burn the player"
GameLib_DelEntity(e2);
game_level_reset=1;
// Make fire
e=Entity_Copy(ent_fire);
vec2_copy(e->pos,e2->pos);
GameLib_AddEntity(e);
// Broken player
e=Entity_Copy(ent_player_broken);
vec2_copy(e->pos,e2->pos);
GameLib_AddEntity(e);
GameLib_PlaySound(snd_burn,(int)e2->pos[0],(int)e2->pos[1]);
GameLib_DelEntity(e2);
game_level_reset=1;
}
}
@@ -262,7 +267,7 @@ int arrow_collision(Entity e1,Entity e2,float t,vec2 n){
}
void arrowshooter_oncopy(Entity e){
e->A=rand()%30;
e->A=(rand()%15);
}
void arrowshooter_proc(Entity e,int ft){
@@ -274,7 +279,7 @@ void arrowshooter_proc(Entity e,int ft){
GameLib_AddEntity(e2);
GameLib_PlaySound(snd_shootarrow,(int)e->pos[0],(int)e->pos[1]);
e->A=60;
e->A=15;
}else{
e->A--;
}
@@ -292,6 +297,7 @@ void savepoint_overlap(Entity e1,Entity e2){
if(game_level_point!=e1->A){
game_level_point=e1->A;
GameLib_PlaySound(snd_savepoint,(int)e1->pos[0],(int)e1->pos[1]);
SaveGame();
}
if(e1!=_savepoint){
AnimPlay_SetAnim(&e1->anim,anim_savepoint_active);
@@ -316,6 +322,7 @@ void exitpoint_overlap(Entity e1,Entity e2){
GameLib_DelEntity(e2);
GameLib_PlaySound(snd_exitpoint,(int)e1->pos[0],(int)e1->pos[1]);
SaveGame();
}
}
@@ -328,6 +335,7 @@ void endpoint_overlap(Entity e1,Entity e2){
GameLib_DelEntity(e2);
GameLib_PlaySound(snd_exitpoint,(int)e1->pos[0],(int)e1->pos[1]);
SaveGame();
}
}
@@ -396,7 +404,7 @@ void GameEnts_Init(){
img_hole_spiked=Draw_LoadImage("data/hole_spiked.png");
Draw_SetOffset(img_hole_spiked,-16,-16);
anim_hole_lava=Anim_LoadAnim("data/hole_lava.png",32,2,3);
anim_hole_lava=Anim_LoadAnim("data/hole_lava.png",32,2,5);
Anim_SetOffset(anim_hole_lava,-16,-16);
img_player_up=Draw_LoadImage("data/player_up.png");
@@ -472,8 +480,11 @@ void GameEnts_Init(){
ent_player=Entity_Copy(ent);
ent_player->type=Ent_Player;
ent_player->radius=16.0f;
ent_player->mass=70.0f;
ent_player->backFric_static=0.5f;
ent_player->width=24;
ent_player->height=24;
ent_player->mass=30.0f;
ent_player->backFric_static=2.5f;
ent_player->backFric_dynamic=0.3f;
ent_player->flags=
EntityFlag_Collision|EntityFlag_Overlap|EntityFlag_Light;
Entity_SetLight(ent_player,0.4f,0.4f,0.4f,3*32.0f);
@@ -487,22 +498,28 @@ void GameEnts_Init(){
ent_barrel->flags=
EntityFlag_Collision|EntityFlag_Overlap;
ent_barrel->radius=16.0f;
ent_barrel->mass=100.0f;
ent_barrel->backFric_static=0.5f;
ent_barrel->width=24;
ent_barrel->height=24;
ent_barrel->mass=25.0f;
ent_barrel->backFric_static=2.0f;
ent_barrel->backFric_dynamic=0.5f;
ent_barrel->proc=barrel_proc;
AnimPlay_SetImg(&ent_barrel->anim,img_barrel);
ent_column=Entity_Copy(ent);
ent_column->type=Ent_Column;
//ent_column->flags=EntityFlag_BlockCollision;
ent_column->flags=EntityFlag_Collision;
//ent_column->flags=0;
ent_column->radius=12;
ent_column->width=24;
ent_column->height=24;
AnimPlay_SetImg(&ent_column->anim,img_column);
ent_column_faded=Entity_Copy(ent_column);
AnimPlay_SetImg(&ent_column_faded->anim,img_column_faded);
ent_rock=Entity_Copy(ent_column);
AnimPlay_SetImg(&ent_rock->anim,img_rock);
ent_rock->flags=EntityFlag_Collision;
ent_lamp=Entity_Copy(ent_rock);
AnimPlay_SetImg(&ent_lamp->anim,img_lamp);
ent_lamp->flags=
@@ -544,6 +561,7 @@ void GameEnts_Init(){
ent_hole_lava->radius=18;
AnimPlay_SetAnim(&ent_hole_lava->anim,anim_hole_lava);
Entity_SetLight(ent_hole_lava,1.0f,0.0f,0.0f,4*32.0f);
ent_hole_lava->oncopy=hole_lava_oncopy;
ent_hole_lava->overlap=hole_lava_overlap;
@@ -558,16 +576,16 @@ void GameEnts_Init(){
ent_arrow_up->proc=timeoutent_proc;
ent_arrow_up->A=120;
AnimPlay_SetImg(&ent_arrow_up->anim,img_arrow_up);
vec2_set(ent_arrow_up->vel,0,-4);
vec2_set(ent_arrow_up->vel,0,-16);
ent_arrow_down=Entity_Copy(ent_arrow_up);
AnimPlay_SetImg(&ent_arrow_down->anim,img_arrow_down);
vec2_set(ent_arrow_down->vel,0,4);
vec2_set(ent_arrow_down->vel,0,16);
ent_arrow_left=Entity_Copy(ent_arrow_up);
AnimPlay_SetImg(&ent_arrow_left->anim,img_arrow_left);
vec2_set(ent_arrow_left->vel,-4,0);
vec2_set(ent_arrow_left->vel,-16,0);
ent_arrow_right=Entity_Copy(ent_arrow_up);
AnimPlay_SetImg(&ent_arrow_right->anim,img_arrow_right);
vec2_set(ent_arrow_right->vel,4,0);
vec2_set(ent_arrow_right->vel,16,0);
ent_arrowshooter_up=Entity_Copy(ent);
@@ -591,7 +609,7 @@ void GameEnts_Init(){
ent_savepoint=Entity_Copy(ent);
ent_savepoint->type=Ent_SavePoint;
ent_savepoint->zorder=0;
ent_savepoint->sortYOffset=-5;
ent_savepoint->flags=EntityFlag_Overlap|EntityFlag_Light;
ent_savepoint->radius=20;
Entity_SetLight(ent_savepoint,0.0f,0.0f,0.5f,2*32.0f);
@@ -636,7 +654,8 @@ void GameEnts_Init(){
Entity_SetLight(ent_fire,1.0f,0.0f,0.0f,3*32.0f);
AnimPlay_SetAnim(&ent_fire->anim,anim_fire);
ent_fire->proc=timeoutent_proc;
ent_fire->A=60;
ent_fire->A=15;
ent_fire->sortYOffset=1;
ent_player_broken=Entity_Copy(ent);
ent_player_broken->type=Ent_Effect;

View File

@@ -101,7 +101,7 @@ void Anim_Draw(Anim a,int time_ms,int x,int y){
Animation *anim=a;
int frame;
frame=(time_ms%anim->time)/anim->ftime;
frame=(time_ms/anim->ftime)%anim->frames;
Draw_DrawImgPart(anim->img,x,y,anim->w,frame);
}

View File

@@ -438,27 +438,60 @@ void Draw_Clean(
// Draw_LoopIteration
//
// One iteracion of the loop updating the game window.
int (*_proc_func)()=NULL;
void (*_draw_func)(float f)=NULL;
void (*_proc_func)(void *data)=NULL;
void (*_draw_func)(void *data,float f)=NULL;
void *_data=NULL;
int _draw_looping=0;
int _draw_exitoverrided=0;
long long _accTime;
int Draw_LoopIteration(){
SDL_Event event;
Uint8* keys;
int done=0;
// Update screen
SDL_GL_SwapBuffers();
// Process Events
#ifdef EMSCRIPTEN
while(SDL_PollEvent(&event) ){
if(event.type == SDL_QUIT ){
done=1;
Input_SetKey(InputKey_Exit,1);
}
if(event.type == SDL_KEYDOWN ){
if(event.key.keysym.sym == SDLK_ESCAPE ) {
done=1;
Input_SetKey(InputKey_Exit,1);
}
}
if(event.type==SDL_MOUSEBUTTONDOWN || event.type==SDL_FINGERDOWN || event.type==SDL_TOUCHBUTTONDOWN){
Input_SetPointerDown(1);
}
if(event.type==SDL_MOUSEBUTTONUP || event.type==SDL_FINGERUP || event.type==SDL_TOUCHBUTTONUP){
Input_SetPointerDown(0);
}
}
#else
while(SDL_PollEvent(&event) ){
if(event.type == SDL_QUIT ){
Input_SetKey(InputKey_Exit,1);
if(!_draw_exitoverrided){
_draw_looping=0;
}
}
if(event.type == SDL_KEYDOWN ){
if(event.key.keysym.sym == SDLK_ESCAPE ) {
Input_SetKey(InputKey_Exit,1);
if(!_draw_exitoverrided){
_draw_looping=0;
}
}
}
if(event.type==SDL_MOUSEBUTTONDOWN){
Input_SetPointerDown(1);
}
if(event.type==SDL_MOUSEBUTTONUP){
Input_SetPointerDown(0);
}
}
#endif
#ifndef EMSCRIPTEN
// Process keys for Draw
@@ -477,12 +510,11 @@ int Draw_LoopIteration(){
if(_accTime>100000){
_accTime=100000;
}
while(_accTime>=proc_t_frame && !done){
while(_accTime>=proc_t_frame && _draw_looping){
Input_Frame();
if(!_proc_func()){
done=1;
}
_proc_func(_data);
_accTime-=proc_t_frame;
Input_SetKey(InputKey_Exit,0);
}
}
@@ -490,11 +522,11 @@ int Draw_LoopIteration(){
if(_draw_func){
float frameFactor=0.0f;
frameFactor=(float)_accTime/(float)proc_t_frame;
_draw_func(frameFactor);
_draw_func(_data,frameFactor);
Draw_Flush();
}
return done;
return _draw_looping;
}
#ifdef EMSCRIPTEN
@@ -514,16 +546,23 @@ void Draw_LoopIterationAux(){
// Draw_Loop
//
// Loops updating the game window.
void Draw_Loop(int (*proc)(),void (*draw)(float f)){
void Draw_Loop(
void (*proc)(void *data),
void (*draw)(void *data,float f),
void *data)
{
long long newTime;
long long procTime1,procTime2,drawTime1,drawTime2,waitTime;
_proc_func=proc;
_draw_func=draw;
_data=data;
if(_draw_looping){return;}
_draw_looping=1;
#ifndef EMSCRIPTEN
_accTime=proc_t_frame;
procTime1=drawTime1=Time_GetTime();
while(!Draw_LoopIteration()){
while(Draw_LoopIteration()){
// Wait to round draw_t_frame
drawTime2=Time_GetTime();
@@ -540,11 +579,35 @@ void Draw_Loop(int (*proc)(),void (*draw)(float f)){
#else
_accTime=proc_t_frame;
_procTime1=Time_GetTime();
emscripten_set_main_loop(Draw_LoopIterationAux, _fps, 1);
if(_fps<=50){
emscripten_set_main_loop(Draw_LoopIterationAux, _fps, 1);
}else{
emscripten_set_main_loop(Draw_LoopIterationAux, 0, 1);
}
#endif
}
/////////////////////////////
// Draw_BreakLoop
//
// Breaks the drawing loop
void Draw_BreakLoop(){
#ifndef EMSCRIPTEN
_draw_looping=0;
#endif
}
/////////////////////////////
// Draw_OverrideExit
//
// Overrides the default exit mechanism
void Draw_OverrideExit(int override){
_draw_exitoverrided=override;
}
/////////////////////////////
// Draw_CreateImage
//

View File

@@ -25,7 +25,24 @@ void Draw_Clean(
// Draw_Loop
//
// Loops updating the game window.
void Draw_Loop(int (*proc)(),void (*draw)(float f));
void Draw_Loop(
void (*proc)(void *data),
void (*draw)(void *data,float f),
void *data);
/////////////////////////////
// Draw_BreakLoop
//
// Breaks the drawing loop
void Draw_BreakLoop();
/////////////////////////////
// Draw_OverrideExit
//
// Overrides the default exit mechanism
void Draw_OverrideExit(int override);
/////////////////////////////

View File

@@ -34,6 +34,7 @@ Entity Entity_New(){
vec2_set(e->pos,0.0f,0.0f);
e->flags=EntityFlag_Collision|EntityFlag_Overlap;
e->zorder=1;
e->sortYOffset=0;
vec2_set(e->dir,0.0f,0.0f);
@@ -99,6 +100,7 @@ Entity Entity_Copy(Entity e){
vec2_set(n->pos,e->pos[0],e->pos[1]);
n->flags=e->flags;
n->zorder=e->zorder;
n->sortYOffset=e->sortYOffset;
vec2_set(n->vel,e->vel[0],e->vel[1]);
n->radius=e->radius;
@@ -636,12 +638,14 @@ int Entity_CollisionInfoResponse(CollisionInfo collInfo){
// Handle colision
int response=1;
int rc;
vec2 n1;
vec2 n2;
vec2_copy(n1,collInfo->n);
vec2_scale(n2,collInfo->n,-1.0f);
// Check the collision methods
if(collInfo->ent1->collision){
rc=collInfo->ent1->collision(collInfo->ent1,collInfo->ent2,collInfo->t,collInfo->n);
rc=collInfo->ent1->collision(collInfo->ent1,collInfo->ent2,collInfo->t,n1);
if (rc==0)
response=0;
if (rc>1)
@@ -667,7 +671,7 @@ int Entity_CollisionInfoResponse(CollisionInfo collInfo){
{
Entity_CollisionResponseCircle(collInfo->ent1,collInfo->ent2,collInfo->t,n2);
}else{
Entity_CollisionResponseCircle(collInfo->ent2,collInfo->ent1,collInfo->t,collInfo->n);
Entity_CollisionResponseCircle(collInfo->ent2,collInfo->ent1,collInfo->t,n1);
}
}
return(1);

View File

@@ -30,6 +30,7 @@ struct TEntity {
vec2 pos;
int flags;
int zorder;
float sortYOffset;
vec2 dir;

View File

@@ -17,7 +17,6 @@
#include "GameLib.h"
// Globals
int _running;
Entity *_entity=NULL;
int *_entity_flag=NULL;
int _n_entities=0;
@@ -28,7 +27,7 @@ void (*_gameproc)()=NULL;
void (*_gamepostproc)()=NULL;
void (*_gamepredraw)(float f)=NULL;
void (*_gamedraw)(float f)=NULL;
int _ft;
int _pft;
int _game_size[2];
int _game_pos0[2];
int _game_pos1[2];
@@ -64,7 +63,7 @@ int GameLib_Init(int w,int h,char *title,int pfps,int fps){
_game_pos1[0]=0;
_game_pos1[1]=0;
_ft=1000/fps;
_pft=1000/pfps;
return(1);
}
@@ -106,6 +105,8 @@ void GameLib_AddEntity(Entity e){
// Mark for light update
Entity_MarkUpdateLight(e,_entity,_n_entities);
Entity_CalcBBox(e);
}
@@ -188,14 +189,14 @@ void GameLib_Compactate(){
// GameLib_ProcLoop
//
// Process the loop.
int GameLib_ProcLoop(){
void GameLib_ProcLoop(void *data){
int i,j;
int repeat,count;
long long time;
// Step the gamePosition
_game_pos0[0]=_game_pos1[0];
_game_pos0[0]=_game_pos1[0];
_game_pos0[1]=_game_pos1[1];
// Process
time=Time_GetTime();
@@ -206,7 +207,7 @@ int GameLib_ProcLoop(){
for(i=0;i<_n_entities;i++){
if(!_entity[i])
continue;
Entity_Process(_entity[i],_ft);
Entity_Process(_entity[i],_pft);
}
GameLib_Compactate();
t_proc+=Time_GetTime()-time;
@@ -284,16 +285,20 @@ int GameLib_ProcLoop(){
do{
n2=0;
for(i=1;i<n;i++){
Entity ent1=_entity[i-1];
Entity ent2=_entity[i];
swap=0;
if(_entity[i-1]->zorder > _entity[i]->zorder){
if(ent1->zorder > ent2->zorder){
// Lower level
swap=1;
}else
if(_entity[i-1]->zorder < _entity[i]->zorder){
if(ent1->zorder < ent2->zorder){
// Upper level
}else{
// Same level
if(_entity[i-1]->pos[1] > _entity[i]->pos[1]){
float y1=ent1->pos[1]+ent1->sortYOffset;
float y2=ent2->pos[1]+ent2->sortYOffset;
if(y1 > y2){
swap=1;
}
}
@@ -312,7 +317,7 @@ int GameLib_ProcLoop(){
time=Time_GetTime();
GameLib_Compactate();_entities_lock=1;
for(i=0;i<_n_entities;i++){
Entity_PostProcess(_entity[i],_ft);
Entity_PostProcess(_entity[i],_pft);
if(_entity[i]->flags&EntityFlag_UpdatedPos){
Entity_MarkUpdateLight(_entity[i],_entity,_n_entities);
}
@@ -324,8 +329,6 @@ int GameLib_ProcLoop(){
t_postproc+=Time_GetTime()-time;
fproc_count++;
return(_running);
}
@@ -333,7 +336,7 @@ int GameLib_ProcLoop(){
// GameLib_DrawLoop
//
//
void GameLib_DrawLoop(float f){
void GameLib_DrawLoop(void *data, float f){
long long time;
int i;
int game_pos[2];
@@ -414,8 +417,6 @@ void GameLib_Loop(
void (*gamepredraw)(float f),
void (*gamedraw)(float f))
{
_running=1;
_gameproc=gameproc;
_gamepostproc=gamepostproc;
_gamepredraw=gamepredraw;
@@ -427,16 +428,7 @@ void GameLib_Loop(
t_draw=0;
fproc_count=0;
fdraw_count=0;
Draw_Loop(GameLib_ProcLoop,GameLib_DrawLoop);
}
/////////////////////////////
// GameLib_BreakLoop
//
// Breaks the game loop.
void GameLib_BreakLoop(){
_running=0;
Draw_Loop(GameLib_ProcLoop,GameLib_DrawLoop,NULL);
}

View File

@@ -51,13 +51,6 @@ void GameLib_Loop(
void (*gamedraw)(float f));
/////////////////////////////
// GameLib_BreakLoop
//
// Breaks the game loop.
void GameLib_BreakLoop();
/////////////////////////////
// GameLib_GetPos
// GameLib_SetPos

View File

@@ -9,8 +9,10 @@
// Globals
InputKeyStatus _keys[InputKey_Max];
int _pointerDown=0;
SDL_Joystick *_joy;
/////////////////////////////
// Input_Init
//
@@ -56,8 +58,10 @@ int Input_Init(){
void Input_Frame(){
Uint8* keys;
// Process Keys
// Get keyboard state
keys=(Uint8 *)SDL_GetKeyState(NULL);
// Process Keys
Input_SetKey(InputKey_Action1,keys[SDLK_z]);
Input_SetKey(InputKey_Action2,keys[SDLK_x]);
Input_SetKey(InputKey_Up,keys[SDLK_UP]);
@@ -65,7 +69,7 @@ void Input_Frame(){
Input_SetKey(InputKey_Left,keys[SDLK_LEFT]);
Input_SetKey(InputKey_Right,keys[SDLK_RIGHT]);
Input_SetKey(InputKey_Jump,keys[SDLK_SPACE]);
Input_SetKey(InputKey_Continue,keys[SDLK_RETURN]|keys[SDLK_KP_ENTER]);
Input_SetKey(InputKey_Continue,keys[SDLK_RETURN]|keys[SDLK_KP_ENTER]|_pointerDown);
Input_SetKey(InputKey_DumpProfiling,keys[SDLK_p]);
}
@@ -97,6 +101,14 @@ InputKeyStatus Input_GetKey(InputKey key){
}
/////////////////////////////
// Input_SetPointerDown
//
void Input_SetPointerDown(int pointerDown){
_pointerDown=pointerDown;
}
/////////////////////////////
// Input_AnyKey
//

View File

@@ -33,6 +33,7 @@ typedef enum {
InputKey_Right,
InputKey_Jump,
InputKey_Continue,
InputKey_Exit,
InputKey_DumpProfiling,
@@ -65,6 +66,12 @@ typedef enum {
InputKeyStatus Input_GetKey(InputKey key);
/////////////////////////////
// Input_SetPointerDown
//
void Input_SetPointerDown(int pointerDown);
/////////////////////////////
// Input_AnyKey
//

View File

@@ -17,6 +17,60 @@ float vec2_norm(vec2 v){
return(len);
}
void vec2_orthogonalize4(vec2 v) {
if (fabs(v[0]) > fabs(v[1])) {
if (v[0] >= 0) {
v[0] = 1.0f;
v[1] = 0.0f;
} else {
v[0] = -1.0f;
v[1] = 0.0f;
}
} else {
if (v[1] >= 0) {
v[1] = 1.0f;
v[0] = 0.0f;
} else {
v[1] = -1.0f;
v[0] = 0.0f;
}
}
}
void vec2_orthogonalize8(vec2 v) {
float diff = fabs(fabs(v[0]) - fabs(v[1]));
if (diff > 0.2f) {
if (fabs(v[0]) > fabs(v[1])) {
if (v[0] >= 0) {
v[0] = 1.0f;
v[1] = 0.0f;
} else {
v[0] = -1.0f;
v[1] = 0.0f;
}
} else {
if (v[1] >= 0) {
v[1] = 1.0f;
v[0] = 0.0f;
} else {
v[1] = -1.0f;
v[0] = 0.0f;
}
}
} else {
if (v[0] > 0.0f) {
v[0] = 0.707f;
} else {
v[0] = -0.707f;
}
if (v[1] > 0.0f) {
v[1] = 0.707f;
} else {
v[1] = -0.707f;
}
}
}
/////////////////////////////
// SolveQuadratic

View File

@@ -29,6 +29,9 @@ float vec2_norm(vec2 v);
#define vec2_interpol(v,v1,v2,f) \
(v)[0]=(v1)[0]-f*((v1)[0]-(v2)[0]);\
(v)[1]=(v1)[1]-f*((v1)[1]-(v2)[1]);
void vec2_orthogonalize4(vec2 v);
void vec2_orthogonalize8(vec2 v);
/////////////////////////////

View File

@@ -188,7 +188,7 @@ int GameMap_CreateLevel(int level,int point){
// ArrowShooter up
GameMapAux_CreateEnt(ent_arrowshooter_up,i,j);
}else
if(line[i2]=='T'){
/*if(line[i2]=='T'){
// Teleporter
Entity ent=GameMapAux_CreateEnt(ent_teleporter,i,j);
ent->A=line[i2+1]-'0';
@@ -198,7 +198,7 @@ int GameMap_CreateLevel(int level,int point){
Entity ent=GameMapAux_CreateEnt(ent_teleporter_dest,i,j);
ent->A=line[i2+1]-'0';
}else
*/
{}
}
}

Binary file not shown.

View File

@@ -1,4 +1,4 @@
CC= python /c/Program\ Files/Emscripten/emscripten/1.7.8/emcc
CC= emcc
LAUNCHER= start
RM=rm -rf
@@ -7,9 +7,15 @@ CFLAGS= -s FULL_ES2=1 -s ASM_JS=1 -O1
#LDFLAGS= --embed-file data
LDFLAGS= --preload-file data
RESULT=game.html
BUILDDIR=build-emscripten
ifeq ($(target),release)
CFLAGS= -s FULL_ES2=1 -s ASM_JS=1 -O2 --llvm-lto 1
BUILDDIR=build-emscripten-release
endif
include Makefile.common

Binary file not shown.

Before

Width:  |  Height:  |  Size: 790 B

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 864 B

After

Width:  |  Height:  |  Size: 925 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 881 B

After

Width:  |  Height:  |  Size: 937 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 800 B

After

Width:  |  Height:  |  Size: 868 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@@ -15,9 +15,9 @@
##..................##
##..................##
ll..................ll
##..BBBBBB..BBBBBB..##
##LLLLLLLLrr||||||||##
##..................##
##..................##
##........EE........##
##mmmmmmmmmmmmmmmmmm##
mm..BBBBBB..BBBBBB..mm
mmLLLLLLLLrr||||||||mm
mm..................mm
mm..................mm
mm........EE........mm
mmmmmmmmmmmmmmmmmmmmmm

View File

@@ -13,8 +13,8 @@
##||||||||||||..||||||||||||##
##||........||..||........||## ################
##||..LLLLBB||..||..LLLL..||## ##............##
##||............||........||## ##............##
##||||||||||||||||||||||||||ll########............##
##||............||..BB....||## ##............##
##||||||||||||||||..||||||||ll########............##
##||||||||..||||||............................EE..##
##||||||||..||||||||||||||||llmmmmmmmm............##
##||....BB..||............||mm mm............##

View File

@@ -12,15 +12,15 @@
mm..mm
mm..mm
##########S3##########
##..................##
##............BBBB..##
##................<<##
mm..................mm
mm............BBBB..mm
mm................<<mm
ll..BBBB............ll
##>>................##
##............BBBB..##
##................<<##
mm>>................mm
mm............BBBB..mm
mm................<<mm
ll..BBBB............ll
##>>................##
##..................##
##........EE........##
##mmmmmmmmmmmmmmmmmm##
mm>>................mm
mm..................mm
mm........EE........mm
mmmmmmmmmmmmmmmmmmmmmm

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

BIN
data/textshadow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

8
dist.emscripten.sh Normal file
View File

@@ -0,0 +1,8 @@
#!/bin/sh
make -f Makefile.emscripten target=release clean
make -f Makefile.emscripten target=release
mkdir -p DIST/web
cp -Rv web/* DIST/web/
cp -v build-emscripten-release/game.* DIST/web/

View File

@@ -5,6 +5,8 @@ DIRNAME="Lonely_Ruins"
DATE=$(date +%Y%m%d)
ZIPNAME="$DIRNAME.$DATE.zip"
make -f Makefile.linux clean
make -f Makefile.mingw clean
make -f Makefile.linux
make -f Makefile.mingw

26
dist.win32.sh Normal file
View File

@@ -0,0 +1,26 @@
#!/bin/sh
DIRNAME="Lonely_Ruins"
DATE=$(date +%Y%m%d)
ZIPNAME="$DIRNAME.$DATE.zip"
make -f Makefile.win32 clean
make -f Makefile.win32
mkdir $DIRNAME
cd $DIRNAME
cp -v ../readme.txt ./
cp -v ../build-mingw/game.exe ./game.exe
cp -v ../SDL.dll ./
mkdir data
cp -v ../data/*.bmp data/
cp -v ../data/*.wav data/
cp -v ../data/level_*.txt data/
cd ..
rm $ZIPNAME
zip -r $ZIPNAME $DIRNAME
rm -rf $DIRNAME

BIN
game.exe

Binary file not shown.

BIN
game.save

Binary file not shown.

128
main.c
View File

@@ -6,14 +6,18 @@
#include <math.h>
#include <time.h>
#ifdef EMSCRIPTEN
#include <emscripten.h>
#endif
#include "GameLib.h"
extern int gamelib_debug;
#include "GameEnts.h"
#include "GameMap.h"
int play;
char *saveFilename="saves/game.save";
int game_started=0;
int game_level=0;
int game_level_point=1;
@@ -24,12 +28,18 @@ DrawImg img_end;
DrawFnt font;
int ProcTitle(){
void ProcGame();
void PostProcGame();
void DrawGame(float f);
void ProcTitle(void *data){
int play=0;
if( Input_GetKey(InputKey_Jump)==InputKey_Pressed||
Input_GetKey(InputKey_Continue)==InputKey_Pressed)
{
play=1;
return(0);
}
if( (Input_GetKey(InputKey_Action1)==InputKey_Pressed||
Input_GetKey(InputKey_Action2)==InputKey_Pressed) &&
@@ -37,12 +47,26 @@ int ProcTitle(){
{
play=1;
game_started=0;
return(0);
}
return(1);
if(play){
if(!game_started){
int pos[2]={0,0};
GameLib_SetPos(pos);
game_level=0;
game_level_point=1;
game_level_reset=0;
GameMap_CreateLevel(game_level,game_level_point);
game_started=1;
}
GameLib_Loop(ProcGame,PostProcGame,NULL,DrawGame);
}
if( Input_GetKey(InputKey_Exit)==InputKey_Pressed){
Draw_BreakLoop();
}
}
void DrawTitle(){
void DrawTitle(void *data,float dt){
Draw_Clean(0,0,0);
Draw_SetColor(1.0f,1.0f,1.0f,1.0f);
@@ -55,21 +79,24 @@ void DrawTitle(){
}
Draw_DrawText(font,"By Kableado (VAR)",200,440);
}
int ProcEnd(){
void ProcEnd(void *data){
if( Input_GetKey(InputKey_Jump)==InputKey_Pressed||
Input_GetKey(InputKey_Continue)==InputKey_Pressed)
Input_GetKey(InputKey_Continue)==InputKey_Pressed ||
Input_GetKey(InputKey_Exit)==InputKey_Pressed)
{
return(0);
game_started=0;
game_level=0;
game_level_point=1;
game_level_reset=0;
Draw_Loop(ProcTitle,DrawTitle,NULL);
}
return(1);
}
void DrawEnd(){
void DrawEnd(void *data,float dt){
Draw_Clean(0,0,0);
Draw_SetColor(1.0f,1.0f,1.0f,1.0f);
@@ -94,11 +121,13 @@ void PostProcGame(){
}
game_level_reset=0;
}else{
play=2;
GameLib_BreakLoop();
Draw_Loop(ProcEnd,DrawEnd,NULL);
}
}
}
if(Input_GetKey(InputKey_Exit)==InputKey_Pressed){
Draw_Loop(ProcTitle,DrawTitle,NULL);
}
}
void DrawGame(float f){
@@ -107,9 +136,9 @@ void DrawGame(float f){
Draw_SetColor(1.0f,1.0f,1.0f,1.0f);
sprintf(string, "Level: %d.%d",game_level+1,game_level_point);
Draw_SetColor(0,0,0,0.5f);
Draw_SetColor(0,0,0,0.5f);
Draw_DrawText(font,string,17,17);
Draw_SetColor(1,1,1,1);
Draw_SetColor(1,1,1,1);
Draw_DrawText(font,string,16,16);
if(game_level_reset==2){
@@ -125,40 +154,53 @@ void DrawGame(float f){
Draw_DrawText(font,"You are dead.",300,300);
}else
if(game_level_reset==3){
play=2;
GameLib_BreakLoop();
Draw_Loop(ProcEnd,DrawEnd,NULL);
}
}
void LoadGame(char *fname){
void LoadGame(){
FILE *f;
f=fopen(fname,"rb");
mkdir("saves");
f=fopen(saveFilename,"rb");
if(!f)
return;
fread(&game_level,1,sizeof(int),f);
fread(&game_level_point,1,sizeof(int),f);
if(game_level==0 && game_level_point==1){
game_started=0;
return;
}
GameMap_CreateLevel(game_level,game_level_point);
game_started=1;
fclose(f);
}
void SaveGame(char *fname){
void SaveGame(){
FILE *f;
f=fopen(fname,"wb");
mkdir("saves");
f=fopen(saveFilename,"wb");
if(!f)
return;
fwrite(&game_level,1,sizeof(int),f);
fwrite(&game_level_point,1,sizeof(int),f);
fclose(f);
#if EMSCRIPTEN
EM_ASM(
FS.syncfs(function (err) { });
);
#endif
}
@@ -173,7 +215,7 @@ int main(int argc,char *argv[]){
}
}
GameLib_Init(640,480,"Game",60,60);
GameLib_Init(640,480,"Game",15,60);
img_logo=Draw_LoadImage("data/logo.png");
img_end=Draw_LoadImage("data/end.png");
@@ -182,40 +224,10 @@ int main(int argc,char *argv[]){
GameEnts_Init();
LoadGame("game.save");
#ifndef EMSCRIPTEN
do{
play=0;
Draw_Loop(ProcTitle,DrawTitle);
if(play==1){
if(!game_started){
int pos[2]={0,0};
GameLib_SetPos(pos);
game_level=0;
game_level_point=1;
game_level_reset=0;
LoadGame();
GameMap_CreateLevel(game_level,game_level_point);
game_started=1;
}
GameLib_Loop(ProcGame,PostProcGame,NULL,DrawGame);
}
if(play==2){
Draw_Loop(ProcEnd,DrawEnd);
}
}while(play);
Draw_OverrideExit(1);
Draw_Loop(ProcTitle,DrawTitle,NULL);
SaveGame("game.save");
#else
int pos[2]={0,0};
GameLib_SetPos(pos);
game_level=0;
game_level_point=1;
game_level_reset=0;
GameMap_CreateLevel(game_level,game_level_point);
GameLib_Loop(ProcGame,PostProcGame,NULL,DrawGame);
#endif
return(0);
}

BIN
saves/game.save Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -24,7 +24,7 @@
<div class="menu">
<ul>
<li><a href="#about">About</a></li>
<li><a href="#downloads">Downloads</a></li>
<li><a href="#play">Play</a></li>
<li><a href="#screenshots">Screenshots</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
@@ -46,18 +46,19 @@ The rescuer and the rescued are alone<br>
in a strange place.<br>
<br>
Good Luck!<br>
<p>&nbsp;</p>
<div style="text-align:right;font-size:7pt;"><a href="#top">Back to top.</a></div>
<p>&nbsp;</p>
<!--DOWNLOADS-->
<a name="downloads"></a>
<h1>Downloads</h1>
<p><b><big><a href="Lonely_Ruins.201201.zip">Lonely Ruins</a></big></b> for Windows and Linux.</p>
<p>&nbsp;</p>
<div style="text-align:right;font-size:7pt;"><a href="#top">Back to top.</a></div>
<!--PLAY-->
<a name="play"></a>
<h1>Play</h1>
<div class="columnContainer">
<div class="column2" style="text-align: center;">
<a href="play.html" class="playLink">&#9658; Play</a>
</div>
<div class="column2" style="text-align: center;">
<a href="https://play.google.com/store/apps/details?id=com.var.lonelyruins"><img alt="Get it on Google Play" src="https://developer.android.com/images/brand/en_generic_rgb_wo_45.png"></a>
</div>
</div>
<p>&nbsp;</p>
@@ -73,10 +74,6 @@ Good Luck!<br>
</span>
</p>
<p>&nbsp;</p>
<div style="text-align:right;font-size:7pt;"><a href="#top">Back to top.</a></div>
<p>&nbsp;</p>
<!--CONTACT-->
@@ -87,15 +84,17 @@ Good Luck!<br>
</ul>
<p>&nbsp;</p>
<div style="text-align:right;font-size:7pt;"><a href="#top">Back to top.</a></div>
<div class="toTop"><a href="#top">Back to top.</a></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<b>Copyright &copy; 2011-2012 <a href="/">Valeriano Alfonso</a>.</b></div>
<div class="pie"><!-- PIE -->&nbsp;</div>
<!-- PIE -->
<div class="pie">
<b>Copyright &copy; 2011-2014 <a href="/">Valeriano Alfonso</a>.</b>
</div>
</div>
</td></tr>
</table>

36
web/join.php Normal file
View File

@@ -0,0 +1,36 @@
<?php
// split -b 1024 -a 4 -d game.js game.js
$filelist=array();
$fileout="game.js";
for($i=0;$i<564;$i++){
$filelist[]=sprintf("game.js%04d",$i);
}
// Quitar el limite de tiempo
set_time_limit(0);
// Fusionar ficheros
$out=fopen($fileout,"wb") or die("error creating/opening merged file");
foreach($filelist as $file){
$size=filesize($file);
$in=fopen($file,"rb") or die("error opening file");
$data=fread($in, $size) or die("error reading file");
fclose($in);
fwrite($out,$data,$size) or die("error writing to merged file");
}
fclose($out);
// Limpiar
foreach($filelist as $file){
unlink($file);
}
unlink("join.php");
?>
<html>
<body>
<h1>OK!</h1>
</body>
</html>

133
web/play.html Normal file
View File

@@ -0,0 +1,133 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Lonely Ruins</title>
</head>
<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
font-family: Verdana,Arial,Helvetica,sans-serif;
background-color:#000000;
color: #777777;
font-size: 10pt;
}
h1{
text-align: left;
margin-top: 0;
margin-bottom: 1em;
font-size: 16pt;
font-weight: bold;
}
.header{
margin:0 auto;
width:600px;
padding-top:10px;
text-align:center;
}
.progress-container{
border: 1px solid #808080;
border-radius: 5px;
padding: 5px;
box-shadow: 0px 0px 5px #808080;
}
.progress-container progress{
width:100%;
}
.game-screen-container{
margin:0 auto;
width:640px;
padding-top:10px;
}
.game-screen-container canvas{
border: 1px solid #808080;
border-radius: 5px;
padding: 5px;
box-shadow: 0px 0px 5px #808080;
}
</style>
<body>
<div class="header">
<a class="titulo" href="./"><img
src="imagenes/logo_lonelyruins_web_mini.png"></a>
</div>
<div class="game-screen-container">
<div id="progress-container" class="progress-container">
<h1>Loading...</h1>
<span>Code:</span></br>
<progress id="progress-code" max="1" value="0"></progress></br>
</br>
<span>Data:</span></br>
<progress id="progress-data" max="1" value="0"></progress></br>
</div>
<canvas class="game-screen" id="canvas" style="display:none;"
oncontextmenu="event.preventDefault()"></canvas>
</div>
<script type='text/javascript'>
var Module = {
preRun: [function (){
FS.mkdir('/saves');
FS.mount(IDBFS, {}, '/saves');
addRunDependency("SaveDir");
FS.syncfs(true, function (err) {
removeRunDependency("SaveDir");
});
}],
postRun: [],
canvas: document.getElementById('canvas'),
progressContainer: document.getElementById('progress-container'),
progressCode: document.getElementById('progress-code'),
progressData: document.getElementById('progress-data'),
print: function(text) {
if(console && console.log){
console.log(text);
}
},
printErr: function(text) {
this.print(text);
},
setStatus: function(text) {
this.print(text);
var m = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/);
if(m){
this.progressData.value = parseInt(m[2]);
this.progressData.max = parseInt(m[4]);
}
},
totalDependencies: 0,
monitorRunDependencies: function(left) {
this.totalDependencies = Math.max(this.totalDependencies, left);
if(!left){
// All loaded
this.progressContainer.style.display="none";
this.canvas.style.display="block";
}
},
LaunchCode: function (){
var xhr = new XMLHttpRequest();
xhr.open('GET', "game.js", true);
xhr.responseType = 'text';
xhr.onprogress = function(event) {
this.progressCode.value = event.loaded;
this.progressCode.max = event.total;
}.bind(this);
xhr.onload = function(event) {
var packageData = xhr.response;
// Launch loaded code
eval.call(null,packageData);
};
xhr.onerror = function(event) {
alert(event);
};
xhr.send(null);
}
};
Module.LaunchCode();
</script>
<!-- <script async type="text/javascript" src="game.js"></script> -->
</body>
</html>

View File

@@ -171,21 +171,53 @@ a.titulo:hover img{
margin: 1px;
border-left:1px solid #777777;
}
.navbar li:first-child{
border-left:none;
}
/* links del navbar */
.navbar a {
padding: 4px;
font-size:12pt;
display:block;
/*border-top: 2px solid rgb(127,127,127);
border-left: 2px solid rgb(96,96,96);
border-right: 2px solid rgb(16,16,16);
border-bottom: 2px solid rgb(0,0,0);
border-radius:7px;
-moz-border-radius:7px;
-webkit-border-radius:7px;
-ms-border-radius:7px;*/
}
.toTop{
text-align:right;
font-size:7pt;
}
.columnContainer{
white-space: nowrap;
font-size: 0;
vertical-align: top;
}
.column2{
width:50%;
display:inline-block;
font-size: 10pt;
vertical-align:top;
}
.playLink{
font-size:25px;
display: inline-block;
border-radius: 10px;
border: solid 1px grey;
width:127px;
height:43px;
line-height:43px;
}
.playLink:link{
color: #777777;
}
.playLink:hover{
box-shadow: 0 0 5px white;
text-shadow: 0 0 2px white;
border: solid 1px white;
text-decoration:none;
color: white;
}