A PHP Error was encountered

Severity: 8192

Message: Function create_function() is deprecated

Filename: geshi/geshi.php

Line Number: 4698

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4698
Function: _error_handler

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4621
Function: _optimize_regexp_list_tokens_to_string

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 1655
Function: optimize_regexp_list

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2029
Function: optimize_keyword_group

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2168
Function: build_parse_cache

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/Process.php
Line: 45
Function: parse_code

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/models/Pastes.php
Line: 517
Function: syntax

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 693
Function: getPaste

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

Enemigos - Stikked
From Rude Sheep, 10 Years ago, written in JavaScript.
Embed
  1. function actualizarEnemigos(){
  2.     function agregarDisparosEnemigos(enemigo){
  3.         //agrega un disparo
  4.         return {
  5.             x: enemigo.x,
  6.             y: enemigo.y,
  7.             width: 17,
  8.             height: 24,
  9.             contador: 0
  10.         }
  11.     }
  12.     //moverlos
  13.     if (juego.estado == 'iniciando'){
  14.         for(var i =0;i<10;i++){//numero de enemigos 10
  15.             enemigos.push({
  16.                x: 10 + (i*50),
  17.                y: 10,
  18.                height: 40,
  19.                width: 40,
  20.                estado: 'vivo',
  21.                contador: 0
  22.             });
  23.         }
  24.         juego.estado = 'jugando';
  25.     }
  26.     //movemos los elementos
  27.     for(var i in enemigos){
  28.         var enemigo = enemigos[i];
  29.         if(!enemigo) continue;
  30.         if(enemigo && enemigo.estado == 'vivo'){
  31.             //si el enemigo esta vivo lo movemos
  32.             enemigo.contador++;
  33.             enemigo.x += Math.sin(enemigo.contador * Math.PI /90)*5;
  34.                
  35.         if(aleatorio(0,enemigos.length * 10) == 4){
  36.            //agregamos un disparo
  37.             disparosEnemigos.push(agregarDisparosEnemigos(enemigo));
  38.                 }
  39.         }
  40.         if(enemigo && enemigo.estado == 'hit'){
  41.             enemigo.contador++;
  42.             if(enemigo.contador <= 20){
  43.                 enemigo.contador = 0;
  44.                 enemigo.estado = 'muerto';
  45.             }
  46.         }
  47.  
  48.     enemigos = enemigos.filter(function(enemigo){
  49.         if(enemigo && enemigo.estado != 'muerto')
  50.             return true;
  51.         else
  52.             return false;
  53.     });
  54. }
  55. }