Skip to content

When using Wren, sync() writes data to cart instead of restoring it #673

Closed
@avi-0

Description

@avi-0

Compare these carts (both created with default sprite and map data):

-- title:  game title
-- author: game developer
-- desc:   short description
-- script: lua

function TIC()
	if btn(4) then mset(0,0,1) end
	if btn(5) then sync() end
	map()
end
// title:  game title
// author: game developer
// desc:   short description
// script: wren

class Game is TIC{
	construct new(){}
	TIC(){
		if(TIC.btn(4)){
			TIC.mset(0,0,1)
		}
		if(TIC.btn(5)){
			TIC.sync()
		}
		TIC.map(0,0)
	}
}

On Lua (also tested js), press A to change a tile in the tilemap, and press B to restore the tilemap, as intended.

On Wren, press A then B. The tilemap is written to the cart. (by the way, why not provide map() in addition to map(_,_)?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions