ha all, first of all im new in programing and js is my first programing lenguage. my quation is: why soe times image dont runs when i add it on the canvas throught js? i did img.onload=()=>{ draw image} but even so, it does not work
var hero = new Image()
hero.src=sprites.hero
hero.onload=()=>{
contexto.drawImage(hero, 0, 0, 32, 32, 20, 29, 52, 61)
}