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 of tilemap functions with Sonic assets (Master System) // by J. Manuel Habas program sonic_infinite_zone; global fpg_zona1, fpg_sonic; tilemap; tile; rings, area; local on_floor = false; gravity_speed = 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 //animate the rings tiles 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 animate = 0; jump = 0; watch = 0; crouched = 0; grafic = 1; times = 0; old_x = 0; incr_x = 0; begin graph = 1; file = fpg_sonic; size = 100; z = 20; ctype = c_scroll; scroll.camera = id; loop animate = 0; watch = 0; crouched = 0; if (on_floor) jump = 0; end if (key(_up) and on_floor) grafic = 20; watch = 1; end if (key(_down) and on_floor) watch = 1; crouched = 1; end if (key(_right) and not watch) if (get_tile(tilemap, x + 8, y + 16) <> 4) //if you don't touch wall tile flags = 0; x += 4; animate = 1; end end if (key(_left) and x > -16 and not watch) if (get_tile(tilemap, x - 8, y + 16) <> 6) //if you don't touch wall tile flags = 1; x -= 4; animate = 1; end end if ((key(_b) or key(_n) or key(_m)) and on_floor) gravity_speed = -13; jump = 1; grafic = 29.5; end if (watch == 0) if (jump == 0) if (animate == 1) if (grafic == 1) grafic = 4.5; times = 0; end grafic += 0.3; if (grafic > 10) times++; end if (times > 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 (crouched == 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 //collect rings 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 //switch to the second tilemap if (area == 0 && x > 1770 && y > 144) tilemap = change_tilemap("0020", 0); area = 1; x -= 1600; end //switch to the first tilemap if (area == 1 && y > 1160) tilemap = change_tilemap("0010", 0); area = 0; y = 100; end graph = round(grafic); old_x = x; gravity(16); // 16 half the size of the vertical graph frame; end end process gravity(center); private gravity_temp; begin father.on_floor = false; gravity_temp = (father.gravity_speed++); //increases the gravity of the object if (gravity_temp > 8) father.gravity_speed = 8; gravity_temp = 8; end if (gravity_temp < 0) //if the object goes up while (gravity_temp++ != 0) //until I stop upping father.y--; end else father.y += gravity_temp; //if the object goes down from gravity_temp =-10 to 8; //set a check range if (get_tile(tilemap, father.x, father.y + gravity_temp + center) == 1 or get_tile(tilemap, father.x, father.y + gravity_temp + center) == 3 or get_tile(tilemap, father.x, father.y + gravity_temp + center) == 5 or get_tile(tilemap, father.x, father.y + gravity_temp + center) == 7) //if you touch different floor tiles father.on_floor = true; break; end end if (gravity_temp < 7) father.y += gravity_temp; father.gravity_speed = 0; end end end
+
Tamaño Código:
Compilar Código
Compilando...