A Flash Developer Resource Site

Page 4 of 5 FirstFirst 12345 LastLast
Results 61 to 80 of 91

Thread: pool game need help

  1. #61
    Senior Member
    Join Date
    May 2016
    Posts
    232
    hello AS3.0

    In a new design I am trying to do without the library and put objects directly on stage
    This makes it easier for us and shortens a lot of codes that I didn't understand
    So I designed a new design and put all the things on stage directly and wrote the first code, but I want you to help in completing the game
    And because you are an expert and love to help beginners like me, so I want to explain each line of code so that I can understand




    new file link

    http://www.mediafire.com/file/vyv9z8...yle+2.swi/file

  2. #62
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,200
    I did one that uses math: download

    just 1 bug to fix when I get back later is hitting the 20 balls full speed first shot the stick didnt show.
    baby you a dime, but with me you $500

  3. #63
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,200
    bug fixed: download

    A balls xvel or yvel wasn't going down to exactly 0 it was staying at decimals
    baby you a dime, but with me you $500

  4. #64
    Senior Member
    Join Date
    May 2016
    Posts
    232
    It seems to me that you are talking to someone as experienced as you, but I am not. I would like if you would like to explain to me step by step how to build the game from scratch in this file
    I will be a happy student

    http://www.mediafire.com/file/vyv9z8...yle+2.swi/file

  5. #65
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,200
    For a video presentation it would have to be done using as3 in animate cc not in swish. Would that be ok? I am very new to the swish IDE and I see you can accomplish more using the swish graphics tools. With as2 I am alittle slow because I do not study as2 anymore but I remember the syntax. Or you are asking for comments? I did not get to comments yet.
    Last edited by AS3.0; 02-27-2021 at 02:43 AM.
    baby you a dime, but with me you $500

  6. #66
    Senior Member
    Join Date
    May 2016
    Posts
    232
    I put the objects directly on the stage. This will shorten a lot of codes and the codes will be directly without calling from the library.
    Let's get started together

    =========================

    PHP Code:
    onFrame (1) { // start action in frame 1
        
    stop() // stop in frame 1
    newgame.onPress=function() {   // when i press the newgame buuton
        
    if(Combo_silver.value.text =="choose the number of balls"){ // if user not choose the number of the balls
            // not do any thing
            
    }
            else  if(
    Combo_silver.value.text ==7){   // if user choose number 7          
                
    balls.gotoAndStop(7);  // in frame 7 there are 7 balls placed
                
    poolstick.gotoAndStop(2); // red poolstick appear in farame 2 but blue poolstick appear in farame 3
                
            
    }
            else  if(
    Combo_silver.value.text ==10){   // if user choose number 10          
                
    balls.gotoAndStop(10);  // in frame 10 there are 10 balls placed
                
    poolstick.gotoAndStop(2); // red poolstick appear in farame 2 but blue poolstick appear in farame 3
                
            
    }





    ===============================

    Now coding gets easier.
    But I do not know where to complete the rest of the codes because it is complex and has many variables and functions

    can you try to this file please

  7. #67
    Senior Member
    Join Date
    May 2016
    Posts
    232
    now you can use the name of any object directly

    for example

    PHP Code:
    _root.poolstick

    _root
    .balls

    _root
    .tablearea 

  8. #68
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,200
    Yes I will put the comments if I have time this coming morning.
    Last edited by AS3.0; 02-27-2021 at 03:29 AM.
    baby you a dime, but with me you $500

  9. #69
    Senior Member
    Join Date
    May 2016
    Posts
    232

  10. #70
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,200
    No I will make an admin tool that lets us design the ball placement and it will generate an array to place the balls for that level design.
    baby you a dime, but with me you $500

  11. #71
    Senior Member
    Join Date
    May 2016
    Posts
    232
    you are the professor , in this case you need a lot of codes because colors and digit numbers of each balls .

    but you can use directly

    PHP Code:
     _root.balls["Blue_ball"+i]
            
    _root.balls["Red_ball"+i

    good luck and happy time

  12. #72
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,200
    I did 100 lines of comments so far, I will need more time:

    I will move your new design to the program I am updating afterwards.

    swish file: download
    baby you a dime, but with me you $500

  13. #73
    Senior Member
    Join Date
    May 2016
    Posts
    232
    thanks for your time

  14. #74
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,200
    You can not play with the balls you edit yet, but you can design maps with the editor:


    to edit map:
    click edit map > drop balls anywhere
    use scroll wheel to change ball frame
    click red X button to stop edit

    to move placed ball:
    click red x
    hold ctrl + click multiple balls you want to move
    use arrow keys to move the balls
    or to delete ball click ctrl on multiple balls at once and click 'z' to delete

    save map to clipboard
    paste your clipboard into the program var map at the top and the number of array it is in is the number to type in the swf and click ok to load it

    or do you prefer your way which was to put the balls in the stage in each frame


    Not finished: download

    Last edited by AS3.0; 03-01-2021 at 03:43 PM.
    baby you a dime, but with me you $500

  15. #75
    Senior Member
    Join Date
    May 2016
    Posts
    232
    I will come back later after my exam is over

  16. #76
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,200
    ok, ill finish the editor when you tell me this method is ok. What course are you taking?
    baby you a dime, but with me you $500

  17. #77
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,200
    bug fix: download
    baby you a dime, but with me you $500

  18. #78
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,200
    2 tray areas 1 for red, 1 for blue: download

    the program didn't come with the best code to enter the tray to begin with so it leaves spaces.
    Last edited by AS3.0; 03-02-2021 at 03:23 PM.
    baby you a dime, but with me you $500

  19. #79
    Senior Member
    Join Date
    May 2016
    Posts
    232
    hello AS3.0
    I was busy days gone

    I am trying to reprogram the file again

  20. #80
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,200
    Ok I left off on post #78 where I put 2 tray areas 1 for blue ball, 1 for red, and the white ball just disappears. I was studying for some other projects when you left. I will add some more comments in the program but first tell me what else is missing and if the comments I left upto line 100 is understandable
    Last edited by AS3.0; 03-30-2021 at 12:29 AM.
    baby you a dime, but with me you $500

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