Ne avevo parlato tempo fa con DarkLeo...ma visto che lui non era interessato ho lasciato perdere...fino a ieri...
ieri ho fatto velocemente questo sistema di "registrazione input"/"playback input" molto simile a quello del mame
praticamente il giocatore può registare una partita e rivederla quando vuole... in teoria si potrebbe associare, (non è ancora implementato ma si può fare) a ogni punteggio della top-ten, la partita che lo ha generato.
ecco il codice che ho usato:
Spoiler
creation code della prima room
Codice: Seleziona tutto
globalvar auto,dfile;
dfile = "wb_demo.rec"
if file_exists(dfile)
auto = true
else
auto = false
room_goto_next()
oggetto oRec della seconda room
Information about object: oRec
Codice: Seleziona tutto
Sprite: <no sprite>
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent: <no parent>
Mask: <same as sprite>
Create Event:
execute code:
if !auto
{
mode = show_message_ext("???","NORMALE","REC","PLAY")
fname = "wb.rec"
}
else
{
mode = 3
fname = dfile
}
if mode == 2
{
file_delete(fname)
fid = file_text_open_write(fname)
//show_message(random_get_seed())
file_text_write_real(fid,random_get_seed())
file_text_writeln(fid)
}
if mode==3
{
fid = file_text_open_read(fname)
random_set_seed(file_text_read_real(fid))
//show_message(random_get_seed())
file_text_readln(fid)
}
Step Event:
execute code:
if mode==2
{
if keyboard_check(ord('Z'))
file_text_write_string(fid,'Z')
if keyboard_check(ord('X'))
file_text_write_string(fid,'X')
if keyboard_check(vk_left)
file_text_write_string(fid,'L')
if keyboard_check(vk_right)
file_text_write_string(fid,'R')
file_text_write_string(fid,"-")
file_text_writeln(fid)
}
if auto
if keyboard_check_pressed(vk_space)
{
show_message("Passo al gioco vero è proprio...")
auto = false
room_restart()
}
if mode==3 if !file_text_eof(fid)
{
io_clear()
str = ""
str = file_text_read_string(fid)
if string_pos('Z', str) > 0
keyboard_key_press(ord('Z'))
if string_pos('X',str) > 0
keyboard_key_press(ord('X'))
if string_pos('L',str) > 0
keyboard_key_press(vk_left)
if string_pos('R',str) > 0
keyboard_key_press(vk_right)
file_text_readln(fid)
}
Other Event: Game End:
execute code:
if mode==2 || mode == 3
file_text_close(fid)
ed ecco il risultato ottenuto:
https://www.youtube.com/watch?v=FiGLm59ky18
la musica l'ho rimossa...se no mi sa che mi oscuravano il video...ad ogni modo dopo aver preso la pistola parte questa musica:
https://www.youtube.com/watch?v=f1JE-TkYZB0