User Tag List

Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 27

Thread: Pong: How to have ball stick to paddle and launch when left click of mouse

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    rubes's Avatar
    Join Date
    May 2011
    Posts
    364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Pong: How to have ball stick to paddle and launch when left click of mouse

    I've been playing w/MMF Dev on and off for a bit (not nearly enough) and I'm having some difficulty in doing something that shouldn't be too hard, but I'm not sure how to code it. In this game, when the ball leaves the bottom of the screen, i would like a life to be lost and the ball to "stick" to the paddle and launch again once a user clicks the mouse. Can someome help me out with what i'm missing.ponger.mfa

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    paobrasil's Avatar
    Join Date
    Apr 2012
    Location
    Rio de Janeiro, Brazil
    Posts
    1,149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok...one minute

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    paobrasil's Avatar
    Join Date
    Apr 2012
    Location
    Rio de Janeiro, Brazil
    Posts
    1,149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well done.

    - First thing I did: I Change the movement type of paddle from [mouse controlled] to [static], the mouse controlled it's not the best choice and was allowing to move the paddle in Y direction too.

    - I created a condition: AWAYS>[hide mouse pointer] and [set X position of paddle to XMouse]. This event will aways set the paddle to mouse coordinate X.

    - I created a Alterable String called [moving] in BALL object.

    - When the ball leaves the play area on the bottom, I add this action: Set Alterable String [moving] to "no".

    - I created a condition: Alterable String [moving] = "no" THEN Set position of ball to position of paddle.

    - I created a condition: User clicks with left button AND Alterable String [moving] = "no" THEN set Alterable String [moving] to "yes"


    There a lot of ways to this that you are trying....I made in this way.....hope you enjoy.....is attached.....
    Attached files Attached files

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    rubes's Avatar
    Join Date
    May 2011
    Posts
    364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sweet, I'm on my iPad but will check out what you did. I'm really interested in seeing how you did the if then

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    paobrasil's Avatar
    Join Date
    Apr 2012
    Location
    Rio de Janeiro, Brazil
    Posts
    1,149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If I remember correctly has a tutorial of pong in tutorials area of ​​the site....and if you go in HELP in the top of you multimedia fusion then click TUTORIALS you will find the chocobreak tutorials.....its a pong game....

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    rubes's Avatar
    Join Date
    May 2011
    Posts
    364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i did choco break when i first purchased mmf, and today i was doing a tutorial from Karen Collins on PONG. I was trying to go out on my own and do a modification, but i didn't know how to do what i wanted. I'm about to load up your version now. Thanks, rubes

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    rubes's Avatar
    Join Date
    May 2011
    Posts
    364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks PaoBrasil, this was very helpful. I completely understand what you are doing and why, which was easy since you spelled it out clearly. I have since modified it to use arrow keys, and to check for collisions on the walls by the paddle, to keep that in the game play. I realize this is a simple exercise, but it is invaluable for learning the concepts. Eventually I'll add the bricks and turn this into a breakout type game.

    What is the recommended way for doing different brick setups? I'm thinking a different frame for each new brick configuration, but in reading the boards, i know people do a lot with arrays and level editors, though i'll need to work up to that, if that is the recommended approach.

  8. #8
    No Products Registered

    Join Date
    Feb 2012
    Posts
    116
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Level editor is definitely a route you could go.
    That would mean you only have to use one frame for all the levels.

    Basically you build a simple level editor where you can place the bricks and then save the brick x and y positions and what kind of bricks they are to an array or file.

    Then you can go for a value that determines the level and load said data accordingly at the frame start.

    Check out Nivrams page which is full of useful examples of all kind if you haven't already.


    Btw. what you are trying to do sounds more like arkanoid than pong

  9. #9
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    rubes's Avatar
    Join Date
    May 2011
    Posts
    364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Blub, this is more arkanoid than pong, but it's all a learning experience, and before there was arkanoid there was breakout, and before breakout, there was pong. I've spent a lot of time reading the forums and reading tutorials, but not as much time actually using the product. I've got the day off, and its way too hot here to even go outside, so I'm puttering away. I know i've seen some discussions on level editors, so once i figure out a few things, I'll work my way to that

  10. #10
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    rubes's Avatar
    Join Date
    May 2011
    Posts
    364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've tried to run a tutorial on Level Editors from Marv's site (great resource) but it requires the ini++ plugin. I've downloaded and installed it, but having issues with this being recognized as the example still says i need to have the plug in. I think i'll do a few different levels with frames, just to get some other concepts down. Nothing earth shattering happening here, just learning the ropes

Page 1 of 3 1 2 3 LastLast

Similar Threads

  1. Pong Tutorial - Ball direcction respect from paddle zone
    By Matriax in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 30th December 2012, 04:46 PM
  2. Mouse movements and left click
    By videogiochi in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 11th January 2011, 04:38 PM
  3. shooting at a mouse object with left click
    By vincent in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 21st June 2009, 05:24 AM
  4. Ball and paddle example
    By nivram in forum File Archive
    Replies: 0
    Last Post: 9th December 2008, 12:11 AM
  5. Left Mouse click with additional condition problem
    By maVado in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 15th July 2007, 01:19 PM

Posting Permissions

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