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 Div GO (Games Online) // by J. Manuel Habas program example_break_back_scroll; global fpg_zone1, fpg_sonic; tilemap; tile; fragment[] = 137, 15, 15, 2, 3, 5, 5, 5, 5, 8, 8, 8, 16, 16, 16, 16, 8; //height of fragments velocity[] = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17; //displacement speed of each fragment local on_floor = false; gravity_speed = 0; begin set_title("Sonic SMS"); set_mode(320, 200, 2); set_fps(60, 0); screen_scanline(40); screen_smooth(false); fpg_zone1 = load_fpg("graficos/sonic-sms/greenhill"); fpg_sonic = load_fpg("graficos/sonic-sms/sonic"); tilemap = new_tilemap("0030"); text_size = 60; text_color = cc_black; write_int(0, 11, 11, 0, offset fps); text_color = cc_white; write_int(0, 10, 10, 0, offset fps); start_scroll(0, fpg_zone1, tilemap, 101, 0, 4); //number, orientation, fragments [], displacement speed [] break_back_scroll(0, 0, fragment, velocity); sonic(160, 200); end process sonic(x, y); private anima = 0; jump = 0; observe = 0; crouched = 0; graphic = 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 anima = 0; observe = 0; crouched = 0; if (on_floor) jump = 0; end if (key(_up) and on_floor) graphic = 20; observe = 1; end if (key(_down) and on_floor) observe = 1; crouched = 1; end if (key(_right) and not observe) if (get_tile(tilemap, x + 8, y + 16) <> 4) //if it doesn't touch wall tile flags = 0; x += 4; anima = 1; end end if (key(_left) and x > -16 and not observe) if (get_tile(tilemap, x - 8, y + 16) <> 6) //if it doesn't touch wall tile flags = 1; x -= 4; anima = 1; end end if ((key(_b) or key(_n) or key(_m)) and on_floor) gravity_speed = -13; jump = 1; graphic = 29.5; end if (observe == 0) if (jump == 0) if (anima == 1) if (graphic == 1) graphic = 4.5; times = 0; end graphic += 0.3; if (graphic > 10) times++; end if (times > 1) if (graphic > 14) graphic = 11; end else if (graphic > 10) graphic = 5; end end else graphic = 1; end else graphic += 0.3; if (graphic > 34) graphic = 30; end end end if (crouched == 1) if (graphic < 21) graphic = 21; end if (graphic == 21 and old_x <> x) incr_x = 0; graphic = 30; end if (graphic > 21 and old_x <> x) if (flags == 0) graphic += 0.2; if (graphic > 34) graphic = 30; end else graphic -= 0.2; if (graphic < 30) graphic = 34; end end x += round(incr_x); y += round(incr_x); incr_x += 0.3; end if (graphic > 21 and old_x == x) graphic = 21; end end graph = round(graphic); old_x = x; gravity(16); // 16 half the size of the vertical graphic 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 it stops going up 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 it touches 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...