Jump to content

Create and destroy


Fire Dragon

Recommended Posts

Can I like create object when program is running?And then,when something happens,destroy it?Like this way.Example in game there is wizard what creates fire ball object,what then flyes towards to your character.If your character collides to it,you lose HP.So how I can make it so wizard like creates that fire ball object?I just learned OOP's basics,but I don't know how call them :) That was easiest thing,I think.Next is little harder.How set it so that fire ball disappearafter some seconds or when it hits player?I know collinsion code,but how I can destroy object?And one more thing,how I can create that same object again,because I want that wizard shoots more than one fire ball?So like how turn object "on" and "off"?Thanks for help.

Link to comment
Share on other sites

I think it is great that you want to tackle such a large project but from what I have seen of your code and what you have told me I really think you should do some simpler projects so you can get a better understanding of what javascript can do.

Link to comment
Share on other sites

I'm now in advanced section.However,in object section was some things like Boolean (what ever it is?)what I didn't understand,but what I learned with my JS book. Maybe I must give up,if I'm so bad coder,or hide somewhere to learn JS... :)

I didn;t say you were a bad coder...you just need to get some more practice before tackling game design...game design needs a very firm understanding of objects and how they work...I would focus on that.
Link to comment
Share on other sites

Maybe I must give up,if I'm so bad coder,or hide somewhere to learn JS... :)

Just give it time, none of us learned javascript etc overnight and i for one still have alot to learn.As aspnetguy said it's great that you have such ambition but you have to learn to crawl before you can walk.Start of with some simple projects to help you understand what the code can do for you then gradually increase the difficulty. :)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...