New to gamesalad - Lighting?

wij_manwij_man Member Posts: 66
edited August 2012 in Working with GS (Mac)
Hi,

I'm brand new to GameSalad. I'm creating my first game and I'm a little stuck on something which is probably basic to you guys! I have an actor (a little ball) and I want to project light around it which doesn't go around my other actors (leaves a shadow).

How can I do this?

Thanks

Comments

  • AcceleratedGamesAcceleratedGames Member Posts: 201
    You should try this:
    1. Create a new actor that has the same image as the ball.
    2. Change that actor's color to black.
    3. If you are doing a game where the view is from the top down, have that actor slightly larger than the ball and it constrain it to the ball's X and Y position and make sure the shadow is right below the ball actor in the layers.
  • wij_manwij_man Member Posts: 66
    Hi,

    That makes sense, but it wouldn't produce a shadow. The basic idea that I'm trying to conceptualise is:

    An Enemy player has a field of vision (Light)
    If the field of vision is limited (object in the way) then the light shows this be casting a shadow (lack of light in that area). I would know how to do this in XNA (vectors...), but in GS I have no idea where to start!
  • MotherHooseMotherHoose Member Posts: 2,456
    @wijman … welcome to GameSalad!

    this may be the effect you want:

    http://forums.gamesalad.com/discussion/comment/299843/#Comment_299843

    look at the posts in that thread by @old_kipper

    hope the link is still working for the demo

    image MH
  • wij_manwij_man Member Posts: 66
    Hi MH,

    That link is VERY helpful, but I don't see how it would avoid corners (other actors). As I'm trying to project field of vision, so something like: http://imagebin.org/223277

    I'm probably being dumb, but I have no idea is this sample can be modified to do that ^
  • MotherHooseMotherHoose Member Posts: 2,456
    edited August 2012
    believe the demo uses a round or oval light image …
    you could use a cone shaped light image for your example
    or for flashlight; spotlight; searchlight effect

    set the black-box actor's Graphics: Blending Mode to normal
    as the light source is behind that actor … you should get lightBlocked effect

    that demo, of those, effects is breath-taking exquisite!
    almost forget to explore the full-potential that @old_kipper has given us!

    image MH
  • RPRP Member Posts: 1,990
    Gnarly. Great link thanks!

    I recently recorded some booming/roaring thunder indoor, outdoors and various house-environments. I'm gonna play with something similar with this masking technique, but also add something for lightning!
  • wij_manwij_man Member Posts: 66
    Hi MH,

    I've uploaded another image using the sample project. http://imagebin.org/223285

    As you can see the light surrounds the box, rather than just lighting the side of the box that would make contact with the light. Am I missing something?
  • wij_manwij_man Member Posts: 66
    I have rather crudely scribbled out the light that I would expect to be missing from the previous image here: http://imagebin.org/223287
  • MotherHooseMotherHoose Member Posts: 2,456
    scribbles are supposed to be shadows?

    think the box actor should control the shadow it will cast ???
    … that would be image with normal blending mode but perhaps decreased opacity?

    you could have the box spawn its shadow … depending on lightPosition

    image MH
  • wij_manwij_man Member Posts: 66
    hmmmm, that's an interesting idea. I didn't think about spawning shadows! :) Not sure exactly how to do that, but I'm glad that I'm heading in the right direction! :)
Sign In or Register to comment.