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
// Ejemplo de funciones de tilemap con assets de Sonic (Master System) // by J. Manuel Habas program sonic_infinite_zone; global fpg_zona1, fpg_sonic; tilemap; tile; rings, area; local en_suelo = false; velocidad_gravedad = 0; private tilegraph = 51, new_tilegraph = 52; begin set_title("Sonic SMS"); set_mode(320, 200, 3); set_fps(60, 0); screen_scanline(40); screen_smooth(false); fpg_zona1 = load_fpg("graficos/sonic-sms/greenhill"); fpg_sonic = load_fpg("graficos/sonic-sms/sonic"); tilemap = new_tilemap("0010"); text_size = 60; text_color = cc_black; write(0, 11, 11, 0, "Rings x"); write_int(0, 65, 11, 0, offset rings); text_color = cc_white; write(0, 10, 10, 0, "Rings x"); write_int(0, 64, 10, 0, offset rings); start_scroll(0, fpg_zona1, tilemap, 100, 0, 4); scroll.ratio = 0; sonic(160, 200); loop //anima los tiles de monedas tilegraph++; if (tilegraph > 56) tilegraph = 51; end new_tilegraph++; if (new_tilegraph > 56) new_tilegraph = 51; end change_tile_value(tilemap, tilegraph, new_tilegraph); frame(500); end end process sonic(x, y); private anima = 0; salto = 0; observa = 0; agachado = 0; grafic = 1; veces = 0; old_x = 0; incr_x = 0; begin graph = 1; file = fpg_sonic; size = 100; z = 20; ctype = c_scroll; scroll.camera = id; loop anima = 0; observa = 0; agachado = 0; if (en_suelo) salto = 0; end if (key(_up) and en_suelo) grafic = 20; observa = 1; end if (key(_down) and en_suelo) observa = 1; agachado = 1; end if (key(_right) and not observa) if (get_tile(tilemap, x + 8, y + 16) <> 4) //si no toca tile de pared flags = 0; x += 4; anima = 1; end end if (key(_left) and x > -16 and not observa) if (get_tile(tilemap, x - 8, y + 16) <> 6) //si no toca tile de pared flags = 1; x -= 4; anima = 1; end end if ((key(_b) or key(_n) or key(_m)) and en_suelo) velocidad_gravedad = -13; salto = 1; grafic = 29.5; end if (observa == 0) if (salto == 0) if (anima == 1) if (grafic == 1) grafic = 4.5; veces = 0; end grafic += 0.3; if (grafic > 10) veces++; end if (veces > 1) if (grafic > 14) grafic = 11; end else if (grafic > 10) grafic = 5; end end else grafic = 1; end else grafic += 0.3; if (grafic > 34) grafic = 30; end end end if (agachado == 1) if (grafic < 21) grafic = 21; end if (grafic == 21 and old_x <> x) incr_x = 0; grafic = 30; end if (grafic > 21 and old_x <> x) if (flags == 0) grafic += 0.2; if (grafic > 34) grafic = 30; end else grafic -= 0.2; if (grafic < 30) grafic = 34; end end x += round(incr_x); y += round(incr_x); incr_x += 0.3; end if (grafic > 21 and old_x == x) grafic = 21; end end //recoge monedas if (get_tile(tilemap, x, y-8) > 50 and get_tile(tilemap, x, y-8) < 57) set_tile(tilemap, x, y-8, 0); rings ++; end //salta al segundo tilemap if (area == 0 && x > 1770 && y > 144) tilemap = change_tilemap("0020", 0); area = 1; x -= 1600; end //salta al primer tilemap if (area == 1 && y > 1160) tilemap = change_tilemap("0010", 0); area = 0; y = 100; end graph = round(grafic); old_x = x; gravedad(16); // 16 la mitad del tamaño del grafico vertical frame; end end process gravedad(centro); private gravedad_temp; begin father.en_suelo = false; gravedad_temp = (father.velocidad_gravedad++); // aumenta la gravedad del objeto if (gravedad_temp > 8) father.velocidad_gravedad = 8; gravedad_temp = 8; end if (gravedad_temp < 0) // si el objeto sube while (gravedad_temp++ != 0) // hasta que deje de subir father.y--; end else father.y += gravedad_temp; //si el objeto baja from gravedad_temp =-10 to 8; //establece un rango de comprobacion if (get_tile(tilemap, father.x, father.y + gravedad_temp + centro) == 1 or get_tile(tilemap, father.x, father.y + gravedad_temp + centro) == 3 or get_tile(tilemap, father.x, father.y + gravedad_temp + centro) == 5 or get_tile(tilemap, father.x, father.y + gravedad_temp + centro) == 7) //si toca distintos tiles de suelo father.en_suelo = true; break; end end if (gravedad_temp < 7) father.y += gravedad_temp; father.velocidad_gravedad = 0; end end end
+
Tamaño Código:
Compilar Código
Compilando...