A Flash Developer Resource Site

Page 2 of 3 FirstFirst 123 LastLast
Results 21 to 40 of 53

Thread: Saving a game

  1. #21
    Member
    Join Date
    Sep 2003
    Location
    CA / Long Beach
    Posts
    45
    i learn how to do the tween, motion, frame by frame, some C++ in 3 hours kinda like non-stop haha.

  2. #22
    Junior Member
    Join Date
    Oct 2003
    Location
    Europe, Holland
    Posts
    26
    Thats not whole flash LOL >.<
    Yeah you need a mysql server but i was you i shall work with passwords .

  3. #23
    Member
    Join Date
    Sep 2003
    Location
    CA / Long Beach
    Posts
    45
    i know alot more, but my brain is kinda in a malfunction mode hahaha... i had been workin on a game for hours tryin to finish up atleast a battle scene etc. T_T

  4. #24
    Junior Member
    Join Date
    Oct 2003
    Posts
    27
    oh um kinda lost i was talking about swish max not flash mx heh

    I dont like mx to much;(
    Game Design Idea's?
    wWw.uFxprOductions.cOm
    Geno@uFxproductions.com
    UltraFleX Productions
    uFx Sr. Producer.

  5. #25
    Member
    Join Date
    Sep 2003
    Location
    CA / Long Beach
    Posts
    45
    heh... ok i'm making a RPG with 3 different character an 3 different race. that mean.................................. I HAVE TO MAKE MILLIONS of codes T_T that'll take 5 months

  6. #26
    Ryan Thomson EvolveDesigns's Avatar
    Join Date
    Oct 2001
    Location
    British Columbia
    Posts
    3,338
    if you don't know much about database creation, just have a password given for each level, then when you go back type in your pass and BAM!
    Evolve Designs Interactive Media
    the natural selection

  7. #27
    Junior Member
    Join Date
    Oct 2003
    Location
    Europe, Holland
    Posts
    26
    Originally posted by AznStyolz
    heh... ok i'm making a RPG with 3 different character an 3 different race. that mean.................................. I HAVE TO MAKE MILLIONS of codes T_T that'll take 5 months
    No, just the levels let the user chose the character and race again.

  8. #28
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    You could use a local shared object to save the information required on the users machine (like a cookie) that way you don't need to use a database and any server side scripting.

    http://www.macromedia.com/support/fl...s/local_so.htm

  9. #29
    Member
    Join Date
    Sep 2003
    Location
    CA / Long Beach
    Posts
    45
    eh this mite just work... i don't understand what you just said, but i'll try to look into it =D

  10. #30
    Member
    Join Date
    Sep 2003
    Location
    CA / Long Beach
    Posts
    45
    heh, ahhhhhhhh my head... ok basically i learned nothing T_T is there a simple site that teaches it?

  11. #31
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    Hi,

    First you can create a shared object using the line,

    code:

    var so = SharedObject.getLocal("test");



    this will create a shared object named test (if one has not already been created)

    lets say you want to remember what level the user was last at when playing you game, when the game starts you can check the shared object to see if there is anything saved there,

    code:

    if (so.data.levelReached != undefined) {
    // there was a levelReached variable saved to the shared object
    // you can now use this value to set up the game based on the level the user had reached
    }




    as the game is player data can be saved on the shared object to keep track of the users progress, using something like,

    code:

    so.data.levelReached = 7; // remember the user was on level 7


  12. #32
    Member
    Join Date
    Sep 2003
    Location
    CA / Long Beach
    Posts
    45
    where do i place the actions at?

  13. #33
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    You could create the shared object in a frame at the start of your game, you could then check the object to see if there was any data saved on it,

    so frame 1 could be,

    code:

    var so = SharedObject.getLocal("someNameForTheSharedObject" );
    if (so.data.levelReached != undefined) {
    // the user has played before use the levelReached variable however it is needed to set up the game
    } else {
    // its a new user so start a new game
    }



    then when the user goes up a level (or whatever, this depends on how you code your game) you can update the value of levelReached on the shared object.

  14. #34
    Member
    Join Date
    Sep 2003
    Location
    CA / Long Beach
    Posts
    45
    ok so i create 1 layer an at frame 1 i paste

    var so = SharedObject.getLocal("someNameForTheSharedObject" );
    if (so.data.levelReached != undefined) {
    // the user has played before use the levelReached variable however it is needed to set up the game
    } else {
    // its a new user so start a new game
    }

    and leave it like that through the whole game? in each scene i put 1 layer (with no other blank/filled frame) and the same action?
    what about loading?

  15. #35
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    to begin, never (I can't empasise that enough) use scenes for anything.

    once the shared object is created (using the code in frame 1) you can read and write to it at will without needing to do anything else, simply save values to the object pretty much like it was a regular variable using,

    so.data.variableName = "somevalue";

    where so is the variable name you stored the reference to the object in.

  16. #36
    Member
    Join Date
    Sep 2003
    Location
    CA / Long Beach
    Posts
    45
    why never use scene?

  17. #37
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    because scenes are a relic from when flash didn't have any significant programming capability, and generally do not work well with movies that use actionscript to any real extent. there are also other far better ways of acheiving similar organisational effects (spliting content into separate swf files for example)

  18. #38
    Member
    Join Date
    Sep 2003
    Location
    CA / Long Beach
    Posts
    45
    before i forget.. how do i disable the rightclicking?

  19. #39
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    In frame 1 of the movie add,

    Stage.showMenu = false;

    (for MX and later) for earlier versions you can edit the HTML of the page by adding

    <param name="menu" value="false">

    in with all the other param name tags and then adding

    menu="false"

    in with the other attributes (width, height etc) of the embed tag.

    Note that this just removes the player controls, the about flash player and settings options will still be there.

  20. #40
    Member
    Join Date
    Sep 2003
    Location
    CA / Long Beach
    Posts
    45
    i see thanks....
    oh yea i've been having a same problem in a shooting game

    I have a bullet counter starting from 6 then decreasing to Zero

    onClipEvent (load) {
    if (Bullet > 0) {
    mousechecker = new Object();
    mousechecker.onMouseDown = function() {
    _root.Bullet = _root.Shot-1;
    _root.Shot = _root.Shot+1;
    _root.Pistol.Play();
    };
    Mouse.addListener(mousechecker);
    }
    }

    the problem is... When the bullet counter Reach 0... the counter continues on an the action continues.

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