Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

164
Views
kaboom.js failed load image

I can't load image in kaboom.js .this my code files root D:\kaboom\src . this my image file root D:\kaboom\public\assets.

js code

import kaboom from 'kaboom';


kaboom({

  font: "sinko",

  background: [0, 0, 255,],
})

loadSprite("bean", "assets/ii.png");

// add a character to screen
add([
  // list of components
  sprite("bean"),
  pos(80, 40),
  area(),
]);

what I am mistake

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Where is your index.html?

I use React to build this game, and set these public files adjoined index.html. Like this:

.
├── MarioGames
│   └── sprites
│       ├── Items.png
│       ├── Mario.json
│       ├── Mario.png
│       ├── OverWorld.json
│       ├── OverWorld.png
│       ├── bigMushy.png
│       ├── brick.png
│       ├── castle.png
│       ├── cloud.png
│       ├── coin.png
│       ├── emptyBox.png
│       ├── enemies.json
│       ├── enemies.png
│       ├── ground.png
│       ├── hill.png
│       ├── pipe.png
│       ├── pipeBottom.png
│       ├── pipeTop.png
│       ├── questionBox.png
│       └── shrubbery.png
├── favicon.ico
├── index.html
├── logo192.png
├── logo512.png
├── manifest.json
└── robots.txt

It's my solution.

    kaboom({
  background: [134, 135, 247],
  width: 320,
  height: 240,
  scale: 2,
  canvas: this.refs.canvas as any,
})

loadRoot('./MarioGames/sprites/')
loadAseprite('mario', 'Mario.png', 'Mario.json')
loadAseprite('enemies', 'enemies.png', 'enemies.json')
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!