documentación
novedades
guía de usuario
listado de funciones
variables y constantes
componentes web
licencia
comunidad
juegos desarrollados
foro de discusión
seguir en facebook
seguir en twitter
ejemplos
primitivas y textos:
draw
write
interacción procesos:
signal
colision
advance
planos:
scroll
mode7
scene3d
reproducción audio / video:
sonidos
video
modplay
efectos:
proceso
región
scroll
juegos:
Super Paf!
Plataformas
Dr. Malvado
Pacoman
Steroid
Pitfall
Exploss
Zelda
Sokoban
Fostiator
Oh Mummy!!
Sonic SMS
Galax
Puzzle
Bricks Breaker
Helio Ball
tutoriales:
0
1
2
3
4
5
6
7
menú
documentación:
novedades
guía de usuario
listado de funciones
variables y constantes
licencia
comunidad:
juegos desarrollados
foro de discusión
seguir en facebook
seguir en twitter
ejemplos:
write
scroll
scene3d
colision
modplay
región
Super Paf!
Dr. Malvado
Pitfall
Sokoban
tutoriales:
0
1
2
3
4
5
descargas
HTML5 Game engine
Entorno de desarrollo de juegos online en HTML5
Haz clic para obtener el control del teclado
Programar a tamaño normal
Programar a tamaño completo
Recuperar PRG
Abrir archivo PRG
Guardar PRG
Buscar
Reemplazar
/* Example Div GO (Div Games Online) by Jose Manuel Habas Steps to run example locally: - Requires installing Node.js and javascript NPM package manager - Create a new folder, go to it and install Websocket libraries with the 'npm install ws' command - Copy the websocket.js file there, included in the Div GO examples folder - Execute command 'node websocket.js' to start the server 'localhost:8080' */ program example_websocket; global socket, i; //change data to identify yourself struct datos; x = 240; y = 240; color = cc_green; //test any color variable: cc_red, cc_green, cc_blue, cc_black... nombre = "Anonymous"; //write your name end //data to be received via websocket struct jugadores[50]; x = 0; y = 0; color = 0; nombre = ""; end begin set_title("Example WebSocket"); //screen options set_mode(480, 480); screen_color(cc_silver); set_fps(60, 0); //socket initialize socket = start_socket("ws://localhost:8080"); while(fading); frame; end text_color = cc_black; text_size = 80; mi_jugador(datos.x, datos.y); loop //get socket data jugadores = get_socket(socket); //and if there are any, it puts them into play with the data obtained for (i = 0; i < sizeof(jugadores) - 1; i++) otros_jugadores(jugadores[i]); end frame; end end process mi_jugador(x, y); private txt, marca; begin graph = color_in_map(0, 2, datos.color); size = 50; x = x; y = y; z = 20; txt = write(0, x, y - 30, 4, datos.nombre); marca = xdraw(0, color_in_map(0, 3, cc_black), x, y, 10, -90000, 100, 0); loop if (key(_up) and y > 10) y -= 4; end if (key(_down) and y < 470) y += 4; end if (key(_left) and x > 10) x -= 4; end if (key(_right) and x < 470) x += 4; end move_text(txt, x, y - 30); move_xdraw(marca, x, y - 50, 10, -90000, 100); datos.x = x; datos.y = y; //send the data with your position or other declared variables set_socket(socket, datos); frame; end end process otros_jugadores(datos); private txt; begin graph = color_in_map(0, 2, datos.color); size = 50; x = datos.x; y = datos.y; z = 20; txt = write(0, datos.x, datos.y - 30, 4, datos.nombre); move_text(txt, x, y - 30); frame; delete_text(txt); end
+
Tamaño Código:
Compilar Código
Compilando...