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
//-------------------------------------------------------------------- // Program: Tutorial 2 // Author: Daniel Navarro Medrano // Date: 20/10/97 //-------------------------------------------------------------------- PROGRAM Tutorial_2; GLOBAL _file[5]; BEGIN // Loads graphics' file _file[0]=load_fpg("graficos/tutorial2"); _file[1]=change_fpg_color(_file[0], cc_blue, cc_yellow, 100); _file[2]=change_fpg_color(_file[0], cc_blue, cc_white, 100); _file[3]=change_fpg_color(_file[0], cc_blue, cc_green, 100); _file[4]=change_fpg_color(_file[0], cc_blue, cc_orange, 100); // Select screen size set_mode(m320x200,2); screen_smooth(false); // Sets the number of frames per second set_fps(24,0); // Puts background screen put_screen(_file[0],41); // Select the font size text_size = 50; // Writes an explanable message write(0,160,2,1,"Press space bar to create planets"); // Creates an endless loop, since no process has been created yet, // and program will end if this loop didn't exist LOOP // Each time the space key is pressed, an earth type // process is created IF (key(_space)) earth(_file[rand(0,4)]); END FRAME; END END //-------------------------------------------------------------------- // Process earth // Handles earth's animations //-------------------------------------------------------------------- PROCESS earth(file); PRIVATE velocity_x; // Horizontal coordinate increment velocity_y; // Vertical coordinate increment initial_velocity_y; // Bounce length BEGIN // Creates process on left middle side x=0; y=1800; resolution=10; // Forces coordinates to use one decimal // Initiates horizontal increment from 1 to 8 points velocity_x=rand(10,80); // Reinitiates initial bounce length from 8 to 25 points initial_velocity_y=rand(-80,-250); // Vertical increment equals bounce length velocity_y=initial_velocity_y; // Creates an endless loop LOOP // Creates a loop that goes over every single image // that composes the animation, which ranges from code numbers 0 to 40 FROM graph=1 TO 40; // Moves process horizontally x=x+velocity_x; // If either side of screen is reached IF (x<0 OR x>3200) // Changes increment sign, so does // with movement direction velocity_x=-velocity_x; END // Moves process vertically y=y+velocity_y; // If bounce height has reached it's limit IF (-velocity_y<=initial_velocity_y) // Reinitiates length to the initial one velocity_y=-velocity_y; ELSE // Decreases increment on bounce length velocity_y=velocity_y+20; END FRAME; // Shows process on screen END END END
+
Tamaño Código:
Compilar Código
Compilando...