Jo Engine Forum

Sega Saturn Development => Share your code => Topic started by: SaturnTeam on July 06, 2018, 12:39:32 am

Title: Ship shadow for shooter demo
Post by: SaturnTeam on July 06, 2018, 12:39:32 am
I wanted to share how to set up the shadow for the main ship in the shooter demo. You'll go under draw_ship in your main C file and enter in the following code under the code that's already there:

Code: [Select]
    if (ship.move == RIGHT)
    jo_sprite_draw3D(ship.reverse_animation ? jo_get_anim_sprite_reverse(ship.anim_id) : jo_get_anim_sprite(ship.anim_id), ship.x +5, ship.y -25, 800);
    if (ship.move == RIGHT)

So I've set the trailing shadow scale to 2.5x less than the actual ship size, in order to present the appearance of distance. At the ship's coordinates (ship.x and ship.y), I've shifted the shadow so it is visible, due to not being directly underneath the ship. You'll have to change the numbers based on your specific game. The Z coordinate of 800 is lower than the coordinate for the ship. This technique can be applied to other craft, too.