Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1052965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:10:43+00:00 2026-05-16T17:10:43+00:00

So I am porting a game I started in html canvas to flash as3.

  • 0

So I am porting a game I started in html canvas to flash as3.

In this game there is a tank. This tank has a body and a turret. It can rotate 360 degrees and move foward and backwards and swivel it’s turret 360 degrees. The tank base and the turret are seperate animated images.

I have set it up so that there is a tank movieclip and a turret movieclip. And I have added code to the tank movieclip so that it creates a turret for itself in the constructor part like this.

 turret= new turretMovieClip();   
 addChild(turret)

So the tank movieclip class now has this turret variable that holds an instance of the turret movieclip. Also in the constructor of the tank movieclip, there is code to give itself a shadow.

var dropShadow:DropShadowFilter = new DropShadowFilter();
dropShadow.distance = 5;
dropShadow.angle = 45;
dropShadow.color = 0x000000;
etc....
this.filters = new Array(dropShadow);

But this is the weird part. I expected the code above to only put a shadow around the tank because this is code for the tank movieclip. But it put a shadow around the tank and the turret. When I added the turret, the tank movieclip changed or something! I did not want this to happen. I want the tank to have it’s own shadow and the turret to have it’s own shadow.

Here is an image I made illustrating the problem:
https://i.stack.imgur.com/EJuf3.jpg

Fig #1 is from my old game. The shadow correctly casts itself over the tank and the ground. Fig #2 shows what the above code did. It gave a shadow for the tank and turret, but it only casts over the ground. Anyone know what I am doing wrong? I think I could fix this by making a master tank class that then creates a tank movieclip and then a turret movieclip. Is that how I’m supposed to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T17:10:43+00:00Added an answer on May 16, 2026 at 5:10 pm

    The simplest would be to start off with an empty Sprite for the Tank class composed by two separate child nodes for the base / turret. That way you can apply two different shadows for these.

       + Tank [Sprite]
       |
       \--+ Base [MovieClip] = Graphics + DropShadow
       |
       \--+ Turret [MovieClip] = Graphics + DropShadow
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently in the process of porting game code from PC to flash,
I am porting PC game to iPad which has ton of graphic assets (over
Is there any porting of Love2D http://love2d.org/ game engine to iPhone/iPad?
I am porting a game, that was originally written for the Win32 API, to
I'm porting some MATLAB functions to Scilab . The cool thing is that there
I'm porting parts of Java project to C# and came across this constant Constant.NamespaceSpecNS.
I'm currently working on a small iPhone game, and am porting the 3d engine
I'm porting a game from UT3 to UDK. One of the classes is a
I'm the lead dev for Bitfighter , and am having problems porting the game
I have a big problem, and I hope you can help me. I'm porting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.