gre / illuminated.js

Illuminated.js – 2D lights and shadows rendering engine for HTML5 applications
http://gre.github.io/illuminated.js
Other
424 stars 40 forks source link

Not possible to move objects? #17

Open craftfortress opened 10 years ago

craftfortress commented 10 years ago

I can see the light position is accessible but if I change the objects parameters (instantiated with the light), their position on the canvas is not updated. Am I doing something basically wrong or will the code need to be updated to handle dynamic movement of objects?

gre commented 10 years ago

I'm not sure if it's that but, do you recall lighting.compute() ?

craftfortress commented 10 years ago

Yep. ... lighting1.objects[1].topleft = new Vec2(0,0); lighting1.compute(canvas.width, canvas.height);

Dimension of object is not changed = (

jasonmcleod commented 10 years ago

@craftfortress you ever find a way to move objects? I'm fighting with it too :P

Thanks!

jasonmcleod commented 10 years ago

@craftfortress I'm back with good news! You have to adjust the points array with the newly calculated values, not just the topleft and bottomright vectors.

I may work on a patch, but this worked for my needs.

craftfortress commented 10 years ago

Thanks! I was about to comment that I would look into when I have a free moment. Cheers for the update. Can I ask what you are working on? = )

jasonmcleod commented 10 years ago

Absolutely! I'm working on the 10,000th reboot of the multiplayer-dungeon-crawler/hack-and-slash that I never seen to finish :P About every 4 months or so, I get the urge to work on (or more often, start over) on a game I played through high school called Dransik. It's similar to the early Ultima games. It's really just a free roaming multiplayer RPG. I'm hoping to include some basic crafting in this version.. and hopefully finish it :]

gre commented 10 years ago

sounds good, oh yeah topleft and bottomright can't be directly change. sounds like a bug, maybe we should rewrite Illuminated.js with more JavaScript ES6 style (setters, etc..).

good luck with your game.

Zetaphor commented 9 years ago

@jasonmcleod, @gre Can one of you please give an example as to what you mean?