effects - Lighting Up A Room Cocos2d -


is possible simulate candle instance in cocos2d. scene black , when candle appears lighten room in realistic way.

if possible, how achieve effect? redirections, guidance welcome.

thanks.

please note, don't want light reflection algorithms, simple use. need game players life abillity see room.

you should check out raycasting. if set cocos2d use box2d, can use box2d's raycasting method achieve effect. can make walls in room box2d rigid-bodies, , raycast candle origin number of points on circle around it. if raycast intersects wall, mark location of intersection. @ end can fill in area light inside polygon created of raycast intersection points.


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -