Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /////////////////////////////////SAVE
- /////////////////////////////////SAVE
- /////////////////////////////////SAVE
- file = get_save_filename(".lvl","")
- if file_exists(file)
- {
- i=show_message_ext("overwrite?","Yes","","No")
- if i = 0 || i = 3 exit;
- }
- f =file_bin_open(file,1)
- writeint(other.f,instance_number(oWall))
- with(oWallEditor)
- {
- writeint(other.f,pointx_1)
- writeint(other.f,pointy_1)
- writeint(other.f,pointx_2)
- writeint(other.f,pointy_2)
- }
- writeint(f,instance_number(oLight))
- with(oLight)
- {
- writeint(other.f,x)
- writeint(other.f,y)
- writeint(other.f,color_get_red(lightColor))
- writeint(other.f,color_get_green(lightColor))
- writeint(other.f,color_get_blue(lightColor))
- writeint(other.f, image_xscale)
- writeint(other.f, image_yscale)
- }
- file_bin_close(f)
- //////////////////////////////////LOAD
- //////////////////////////////////LOAD
- //////////////////////////////////LOAD
- file = get_open_filename(".lvl","")
- if !file_exists(file)
- {
- show_message("file not found!")
- exit;
- }
- f =file_bin_open(file,0)
- n = readint(f)
- repeat(n)
- {
- nx = readint(f)
- ny = readint(f)
- nx2 = readint(f)
- ny2 = readint(f)
- o=instance_create(nx,ny,oWallEditor)
- o.pointx_1 = nx
- o.pointy_1 = ny
- o.pointx_2 = nx2
- o.pointy_2 = ny2
- with(o){vector_wallset()}
- }
- show_message("made it to lights")
- n = readint(f)
- repeat(n)
- {
- o = instance_create(readint(f),readint(f),oLight)
- o.lightColor = make_color_rgb(readint(f),readint(f),readint(f))
- o.image_xscale = readint(f)
- o.image_yscale = readint(f)
- }
- file_bin_close(f)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement