elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Trabajando con las ramas de git (tercera parte)


+  Foro de elhacker.net
|-+  Programación
| |-+  Desarrollo Web (Moderador: #!drvy)
| | |-+  Ayuda Script Flash
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: Ayuda Script Flash  (Leído 3,103 veces)
Sinedra

Desconectado Desconectado

Mensajes: 44


<?php include("Sinedra.php"); ?>


Ver Perfil
Ayuda Script Flash
« en: 15 Febrero 2011, 20:01 pm »

La verdad esque no encontre un foro en donde poner esto :-\ supongo que sera desarrollo web.

Bueno la consulta es acerca de flash, tengo un juego (snake) que encontre por ahi en google hecho en flash muy sencillo, el cual quiero editar para que el puntaje lo pase por get a otra web que yo le indique, el problema es que tengo conocimientos nulos de flash y no tengo idea de como se podria hacer algo asi. busque por google y se me ocurrio agregarle esta linea: getURL("index.php?score=AQUI FALTARIA EL PUNTAJE QUE HIZO UNA VEZ QUE PERDIO", "_self");
tengo claro que no es seguro enviar un puntaje por get ya que se puede editar, pero esa es la idea ya que tengo unos planes distintos para este juego. por otro lado queria consultar si en flash puedo comprimir algo en base64 ya que seria ideal mandar el puntaje en base64. agradeceria un monton que alguien me pueda ayudar. dejo el codigo del juego.
Código:
//--- Flash MX Snake Game 1Kb by Strille. Version 2.2, 746 bytes
//--- Paste this code on frame 1 and set scene size to 512x280 and Frame Rate to 16
//--- The code is not written with speed in mind, only small file size. Not that it is slow :-)

createTextField("t", 1, 1, 255, 511, 32); // create a text field to write score and instructions
t.text = "Snake Game\t-\tPress SPACE"; // show start text
beginFill(0xeeeeee); lineStyle(1); lineTo(511, 0); lineTo(511, 256); lineTo(0, 256); endFill(); // draw background with border

Key.addListener(t); // use an existing object as key listener (we don't waste bytes by creating a new object)
t.onKeyDown = function() { // define an anonymous method to execute when a key is pressed
c = Key.getCode()-37; // get key code (c is a variable used "locally" several times)
if (!(c>>2)) { // arrow keys pressed (c = 0, 1, 2 or 3)
if (c != q[0]) // only add to the queue if it is a new direction
q.unshift(c);
return; // save the turn in the queue and exit method
}

// SPACE or another key other than an arrow key has been pressed
x = 32*8 + 32*520; // snake start pos (left and right side of + can be viewed as x and y coord
q = []; // a queue to store key presses (so that x number of key presses during one frame are spread over x number of frames)
m = []; // create an array to store food pos and snake
createEmptyMovieClip("s", w=0); // create MC to store the snake and the food MC and reset snake counter(w)
e = 2*(m[x-520] = 2*(r=1)); // set erase counter (e) to 4, set current direction (r) to up (1) and set food on the position the snake will be over the first time to place food

onEnterFrame = function () { // MAIN function
c = q.pop(); // ...pick the next turn in the queue (may be undefined if queue is empty)...
if (c%2 != r%2) // ...and check that it is not undefined and not a 180 degree turn (annoying to be able to turn into the snake with one key press)
if (c != undefined)
r = c; // change current direction to the new value

x += [-1, -65, 1, 65][r]*8; // move the snake to a new x position (-1 = left, -65 = up, 1 = right, 65 = down)

if (m[x] == 1 or !(x%520) or !(int(x/520) % 33)) { // GAME OVER if it is a snake block or outside the map on the next position
delete onEnterFrame; // quit looping main function
t.text += "\tGAME OVER!"; return; // type game over text and exit main
}

with(s.createEmptyMovieClip(w, w)) { // place a snake block (or food block the first loop)
beginFill(255<<16); // red food color first time...
if (w++) // ...blue snake color the other times
beginFill(0x555588);
_x = x%520; _y = int(x/520)*8; // set snake block position
lineTo(-7, 0); lineTo(-7, -7); lineTo(0, -7); endFill(); // draw a square
}

m[x] += 1; // set current pos as "occupied" by a snake block

if (m[x] == 3) { // check if there is a food block on the new pos
t.text = "Score: " +(w-(e-=5)-2)*2; // delay erase counter with 5 (the snake will grow 5 blocks each time), calculate and type score (+10p for a food block)
do {} while (m[c = (s[0]._x = 8+random(64)*8)+(s[0]._y = 8+random(32)*8)*65]); // pick a free spot to place the food, save that number, place the food MC
m[c] = 2; // set the position picked on the line above to 2
}

if (e) { // if not food MC (s[0]) then erase last snake MC and entry in array m
c = s[e]; // get last MC
delete m[c._x+65*c._y]; removeMovieClip(c); // delete the value in the array m and delete the MC
}
e++; // increase erase snake counter
}
}

PD: si es muy complicado hacer esto, tambien estoy en busca de algun juego que envie el puntaje por get ojala en base64, puede ser cualquiera por ejemplo ese que cuenta los clicks en 10 seg. muchas gracias


« Última modificación: 15 Febrero 2011, 20:03 pm por Sinedra » En línea

Sinedra

Desconectado Desconectado

Mensajes: 44


<?php include("Sinedra.php"); ?>


Ver Perfil
Re: Ayuda Script Flash
« Respuesta #1 en: 17 Febrero 2011, 02:31 am »

Al final opte por la alternativa del juego de los clicks y resulto lo que queria, gracias de todas maneras si alguien intento buscar la solucion.

Saludos!


En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
action script flash
Diseño Gráfico
prosk8er 0 1,664 Último mensaje 4 Julio 2004, 17:30 pm
por prosk8er
Script de pagina de inicio en flash???
Diseño Gráfico
denacroxis 0 1,760 Último mensaje 3 Junio 2005, 03:17 am
por denacroxis
Manual de Action script (Flash)
Diseño Gráfico
MK-Ultra 2 5,161 Último mensaje 16 Enero 2008, 20:54 pm
por marlon_agz
[shell script] ayuda con script, :( « 1 2 »
Scripting
dark_fidodido 14 10,755 Último mensaje 16 Septiembre 2009, 10:28 am
por dark_fidodido
Ayuda con un ''script'' juego flash
Hacking
Fran1059 0 2,405 Último mensaje 4 Abril 2017, 18:11 pm
por Fran1059
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines