kaboom icon indicating copy to clipboard operation
kaboom copied to clipboard

Anim not found

Open LUIS9799 opened this issue 3 years ago • 4 comments

Version

latest

What browsers are you seeing the problem on?

Chrome, Microsoft Edge, Other

What happened?

So.. i'm recieving this error recently when i added an animation to main character, it can be noticed that i have other animation in a portal (platformer kaboom game) and it works perfect, it only happen when entering to game, however in a couple of refreshes you can actually see that game works as expected

https://user-images.githubusercontent.com/68512719/192177072-5662f052-4e79-41f5-b7aa-37dc9fda9b2c.mp4

this is a video showing it, also i call loadsprite after scene i though that is was the network, so i tired to test it in a corporative network, but there is the same error.. then i tried to move loadsprite after imports, but it does not work i even change the server to a powerful one but it wasn't the server i tried to call assets in same main file but it gives me other error... i tried to get support on kaboom's server but all methods failed.. finally Danie told me to create an issue in github for review, Is it possible to developers to get a quick fix? i really need that this issue gets fixed This is all, i attached a test server on replit in order to show the bug, as i said you need a couple of refreshes to let the game work. Thanks

What's the expected behavior?

This should load game correctly without any errors regarding anims.

Minimum reproducable code

loadSprite("player", "/sprites/sheet.png", {

	sliceX: 9,

	anims: {
		"idle": {
      

			from: 0,
			to: 3,

			speed: 3,
			loop: true,
		},
		"run": {
			from: 4,
			to: 7,
			speed: 10,
			loop: true,
		},

		"jump": 8
	},
})
player.onGround(() => {
	if (!isKeyDown("left") && !isKeyDown("right")) {
		player.play("idle")
	} else {
		player.play("run")
	}
})

player.onAnimEnd("idle", () => {

})

onKeyPress("space", () => {
	if (player.isGrounded()) {
		player.jump(JUMP_FORCE)
    player.biggify(3)
		player.play("jump")
	}
})
	
	onKeyPress("up", () => {
	if (player.isGrounded()) {
		player.jump(JUMP_FORCE)
    player.biggify(4)
		player.play("jump")
	}
})

onKeyDown("left", () => {
	player.move(-MOVE_SPEED, 0)
	player.flipX(true)
  player.biggify(5)
	if (player.isGrounded() && player.curAnim() !== "run") {
		player.play("run")
	}
})

onKeyDown("right", () => {
	player.move(MOVE_SPEED, 0)
	player.flipX(false)
  player.biggify(5)
	if (player.isGrounded() && player.curAnim() !== "run") {
		player.play("run")
	}
})

onKeyRelease(["left", "right"], () => {
	if (player.isGrounded() && !isKeyDown("left") && !isKeyDown("right")) {
		player.play("idle")
	}
})

Live demo

https://pegesourcemain-3.luiscraftyt3.repl.co/jugar

LUIS9799 avatar Sep 26 '22 01:09 LUIS9799

Any answer?

LUIS9799 avatar Oct 01 '22 00:10 LUIS9799

Sorry I didn't understand the problem, the video doesn't seem to show an error and the link doesn't show an error. Did you get the "Anim not found: (anim name)" error message when trying to call play()?

slmjkdbtl avatar Oct 04 '22 09:10 slmjkdbtl

Yes, it shows (anim error) and the anim, normally is a random anim, the issue was partially fixed, but in some cases you can see the error, i think that's why you didn't see any errors, try again

LUIS9799 avatar Nov 25 '22 12:11 LUIS9799

This is not "Minimum reproducable code". If you still want help provide a link to the repository or fix the code in your first comment (where do you define the player component? where do I find the sprite? Etc...)

magical-heyrovsky avatar Aug 14 '23 16:08 magical-heyrovsky