We are about to switch to a new forum software. Until then we have removed the registration on this forum.
For my game I started using simply figures for testing. Now that I had that working, I implemented sprites using images, but my fps starts going down quickly. I can not figure out how to fix this issue.
Answers
Without seeing the code, neither can we
When done right this shouldn't slow things down
some generic advice:
https://forum.processing.org/two/discussion/comment/109112/
e.g.
calling loadImage() every time draw() loops (BAD)
using resize() outside setup, using image() with 5 parameters (instead of 3)
My images are loaded in my first set up function.
not sure if you posted your ninja class. Because you use it when you spawn. Do you use loadimage there?
Nope.
Does addImage count?
I don't know.
Can't you load the image and use it when spawning?
Not sure. Im using a js library called scene manager, which helps me change through different views, would that interfere?
I start with around 60fps, but after a few seconds it starts going down.
If you would like to take a deeper view, I can upload my code to github and then post the link.
I can't help you with that
Formatting
but you can go back and edit your old posts above
(click on the gear and then "Edit")
format your code better:
empty line before and after the entire code section
select entire code with the mouse
hit ctrl-o
OR us the small 'C' in the command bar
(i've done it)
What have you done? @koogs
i'd say createSprite and addImage are odd things to have in show(). sound more like they belong in the constructor, not called every frame. but then, javascript ¯_(ツ)_/¯
Not working @koogs
in which way?