A Flash Developer Resource Site

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Aug 2012
    Posts
    11

    Is there any glossary for code?

    I was wondering if anyone had ever put together a code book with a quick reference glossary?

    I am looking for code to do things like

    Zoom in / Zoom out
    Limit Ammo / Rounds cap
    Failure if wrong target is shot

    Things along these lines.

    cheers

  2. #2
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,770
    Hi,

    it would be quite useless to have such a glossary as those things can be coded in many different ways depending on the context, so you'll have to manually code them according to your game's structure.

    Zoom in / Zoom out - check out MovieClip properties, _xscale and _yscale (e.g. mc._xscale = 200;)

    Limit Ammo / Rounds cap - just make a variable to store the amount of bullets, and prevent it from shooting once it reaches 0 (assuming you are decreasing that variable for each shot), and just turn it back to its default value when reloaded

    Failure if wrong target shot - seriously, this should be pretty easy. Just make it fail if you hit the wrong target, lolz, if it's a button, make it fail, if it's a movieclip, give it an instance name and use hitTest to check if what you've hit any of the wrong targets

    For re-usability, you could have those codes inside Functions, and just reuse them whenever you want (only in the current FLA file, you would have to copy and paste them in new ones as well if you wanted to reuse them there), or for something even more advanced, you could create Classes for each of those functions, with a structure which is easy to implement in most cases, to easily re-use your code (but this is way to advanced for you, I think)
    17 Years old boy, who loves the Computer Technology

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  3. #3
    Junior Member
    Join Date
    Aug 2012
    Posts
    11
    Nig 13,

    Thanks for the code.
    I think classes is way to advanced, but hopefully one day. I think I need to do a course even if it just gives you the bare bones and can go from there.

    cheers

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts




Click Here to Expand Forum to Full Width


HTML5 Development Center