How to make a really basic pong game for a beginner

Hello.  I've read through a couple of threads on here dealing with making a game of pong in LabView, but in them the users had questions with far more complex aspects of the program than I want to deal with.  I am a beginner programmer in LabView with limited experience in Java and Visual Basic programming.  I was tasked with creating a game over winter break, and now that I finally have some time (this weekend that is), I decided that I'd make a really simple game of pong.  However, I have seriously overestimated the difficulty of this for a beginner who has very limited knowledge of Lab View.
I ask you to please have some patience with me.
I know what I want to do, and just need help inplementing it.
Here is the idea for my design to keep it as simple as possible:
-Create a field (I am not sure what to use for this, but from my reading it appears that some sort of a picture output is needed, but I cannot find that anywhere).
-Set up some simple function that can output the dimensions of this field to use with collision tracking.
-Create a ball that can be tracked by the program.
-From my reading I understand that the simplest way to "bounce" the ball off the sides appears to simply reverse the X velocity of the ball when it strikes the vertical boundaries and the Y velocity when it strikes the horizontal boundaries.
-Insert some sort of a "paddle" that the user can control with the left and right arrow keys.
Now, as I have mentioned I am a beginner with approximately one month maximum knowledge of this software, spread over about a year.  I want to take things slow.  So for starters, would anyone be willing to walk me through creating a visual output for this and creating a ball that will bounce off all sides?
If I can at least get that far for now, then I can move on (with help I hope!) of inserting an interactive interface for the "paddle."
I have found some LabView code for a simple game like this, but it also includes a score keeping loop as well as an "automatic play" option, and I am attempting to wade through all that code to find the bones of it to help me with this, but due to my inexperience, this might thake a lot of time.
I thank you for any and all help anyone may be able to provide.

EchoWolf wrote:
-Create a field (I am not sure what to use for this, but from my reading it appears that some sort of a picture output is needed, but I cannot find that anywhere).
 Wel, there is the picture indicator in the picture palette. In newer versions it's called "2D picture". The palettes have a search function. Using the palette search function is a basic LabVIEW skill that you should know. If you've seen the example for the other discussion, it uses a 2D boolean array indicator. The boolean array is only recommended for a monochrome very low resolution display.
EchoWolf wrote: -Set up some simple function that can output the dimensions of this field to use with collision tracking.
-Create a ball that can be tracked by the program.
That seems backwards. Properly programmed, the code always knows the dimension and the ball position. The program generates, (not tracks!) the ball movement. Of course you need to do some range checking on the ball position to see when it collides with the walls.
EchoWolf wrote:
-From my reading I understand that the simplest way to "bounce" the ball off the sides appears to simply reverse the X velocity of the ball when it strikes the vertical boundaries and the Y velocity when it strikes the horizontal boundaries.
Of course you could make it more realistic by keeping track of three ball parameters: x, y, spin.
EchoWolf wrote:
-Insert some sort of a "paddle" that the user can control with the left and right arrow keys.
Pong is typically played with the up-down arrow keys.
EchoWolf wrote:
Now, as I have mentioned I am a beginner with approximately one month maximum knowledge of this software, spread over about a year.
LabVIEW knowledge is not measured in time units. What did you do during that month? Did you attend some lectures, study tutorials, wrote some programs?
EchoWolf wrote:
So for starters, would anyone be willing to walk me through creating a visual output for this and creating a ball that will bounce off all sides?
I have found some LabView code for a simple game like this, but it also includes a score keeping loop as well as an "automatic play" option, and I am attempting to wade through all that code to find the bones of it to help me with this, but due to my inexperience, this might thake a lot of time.
Start with the posted example and delete all the controls and indicators that you don't want, then surgically remove all code with broken wires.
Alternatively, start from scratch: Create your playing field. Easiest would be a 2D classic boolean array that is all false. Use initialize array to make it once. Now use a loop to show the ball as a function of time.
Start with a random ball position. to display it, turn one of the array elements true before wiring to the array indicator using replace array subset.
Keep a shift register with xy positions and xy velocities and update the positions as a function of the velocities with each iteration of the loop. Do range checking and reverse the velocieis when a edge is encountered.
What LabVIEW version do you have?
LabVIEW Champion . Do more with less code and in less time .

Similar Messages

  • How to make a really basic alleyway for a beginner

      Hello,I am a student making a project related to games and I picked an alleyway.I've
    read through a couple of threads on here dealing with making a game of
    alleyway in LabView.I a still a newbie and I am asking for some
    guideance inorder to be able to make such a game.I ask you to please have some patience with me.
      I
    am ,as you figured it out ,EchoWolf's class mate. And I also like also
    to learn LabView not just coping and cheating for I would like to
    increase my knowledge in LabView and because the purpose of this assignment is to learn.
     I
    have seen with EchoWolf's post and I was impressed how I was able to
    make a ball bounce from different starting positions and different
    angles.
    As I want to keep this game basic, I don't think I'll worry about having different ball speeds so far.
    Alley
    way is a game when the ball hits the brick and it
    breaks(disappears),how can I do it do I need to vanish it using the
    property node.
    I am sorry, I was not taught enough and I only ask
    for guideance and patience for I am a quick learner and I am very good
    at Math and Physics and I have some experience in C++ although the
    syntax stinks.
    Due to my inexperience, this might thake a lot of time.I thank you
    for any and all help anyone may be able to provide. Thank you in
    advanced for your patience.May I never fail you.
    This is what I have found .XD
     I am having trouble posting this message.
    “Give a man a fish and he will eat for a day; teach a man to fish and he will eat for a lifetime”
    "to learn a lesson is a far better reward than to win a prize early in the GAME"
    Attachments:
    alleyway.llb ‏318 KB

    LOL,
    First, let's play nice and actually give the source of the code you attached. I have the gut feeling that it is overly complicated and could be done with 25% of the code.
    As a first step, I would enable "smooth updates" on the image indicator to prevent the annoying flickering
    Echo Wolf2 wrote:
    As I want to keep this game basic, I don't think I'll worry about having different ball speeds so far.
    Yes, you have to worry, because the speed e.g. needs to change sign when it hits an object. Of course you could solve it with complex data and keep the speed magnitude constant.
    Echo Wolf2 wrote:
    Alley way is a game when the ball hits the brick and it breaks(disappears),how can I do it do I need to vanish it using the property node.
    I don't think you understand the meaning of "property node". What exactly did you have in mind?
    Echo Wolf2 wrote:
    I am sorry, I was not taught enough and I only ask for guideance and patience for I am a quick learner and I am very good at Math and Physics and I have some experience in C++ although the syntax stinks.
    It's probably the wrong approach trying to reverse engineer existing complicated code, so what I would do is start with some simple code like your classmate, writing someting where the ball bounces off walls only. Then you can expand it and add bricks. At the end add a paddle for user control.
    Make a plan about good data structures. How is the arena represented in memory?
    Echo Wolf2 wrote:
    Due to my inexperience, this might thake a lot of time.I thank you for any and all help anyone may be able to provide. Thank you in advanced for your patience.May I never fail you.
    The only way to really gain experience is to write programs. It's been 6+ hours since you posted. How far did you get in the meantime? Show us what you are doing and please ask questions when you get stuck.
    We won't write assignments for you, but we are willing to nudge you in the right direction.
    LabVIEW Champion . Do more with less code and in less time .

  • How to make "Levels" in simple java game

    I just wanted to know if anybody knew how to make "Levels" in a java game. In my case, it is to change two polygons that are used in the background. I think you have to use an array of some kind, but i dont really know.
    Here is my source, the polygons are by the massive ///////// areas.
    I cut out the majority of the program, because it was too long.
    public class collision extends Applet implements MouseListener,MouseMotionListener
        private  Image rickImage,mazeImage;
       Image Buffer;
       Graphics gBuffer;
       int x, y;
       int[] LeftWallX = {0,204,204,149,149,162,162,243,260,235,259,232,260,230,207,207,0};
       int[] LeftWallY = {500,499,402,402,341,324,227,191,157,141,135,123,116,109,86,1,1};
       //int[] PlayAreaX = {204,204,149,149,162,162,243,260,235,259,232,260,230,207,207,263,263,245,282,262,274,257,273,250,184,184,170,170,208,216,216};
      // int[] PlayAreaY = {499,402,402,341,324,227,191,157,141,135,123,116,109,86,1,1,86,103,115,129,138,147,155,201,230,323,340,384,384,402,499};
       int[] RightWallX = {500,500,263,263,245,282,262,274,257,273,250,184,184,170,170,208,216,216};
       int[] RightWallY = {500,0,1,86,103,115,129,138,147,155,201,230,323,340,384,384,402,499};
       boolean mouseInside, collide;
       boolean rolled = false;
       boolean msg = true;
       int sX=204,sY=490,sW=12,sH=9;
       //Declare the rectangles
       Rectangle  movingRect,finshBloc,startBloc,oopsBloc;
       //Declare the polygons
       Polygon leftWall,playerArea,rightWall;
            ///Initiate
            public void init()
                 rickImage = getImage(getDocumentBase(), "rick.jpg");
                 mazeImage = getImage(getDocumentBase(), "maze1.jpg");
                 collide=false;
                 Buffer=createImage(getSize().width,getSize().height);
                 gBuffer=Buffer.getGraphics();
                 rightWall=new Polygon(RightWallX,RightWallY,18);
                 playerArea= new Polygon(PlayAreaX,PlayAreaY,31);
                 leftWall= new Polygon(LeftWallX,LeftWallY,17);
            public void paint(Graphics g)
                 drawStuff();
                 g.drawImage (Buffer,0,0, this);
    */

    I'm not exactly sure in your case what you are trying to accomplish. If all you want to do is make new polygons for your levels then you will simply need a Vector of type level (or polygon). Store multiple levels/polygons in that vector. This can be done many ways, probably the most efficient way would be to create a class Level of sorts and create each level object from there. This way you have all your levels stored into that vector.
    I have made programs where the levels/mazes are randomly generated based on certain parameters (this way you would not need to define any specific level). This can be done inside the Level class and added to the vector so that when a level is randomly generated there are literally infinite possibilities. I would suggest posting all your code or at least a breakdown UML diagram of what is going on in your entire program.

  • Basic apps/games for the nano 6th generation

    Question for Apple:
    Are the any plans for additional updates. For example it would be good if there were a few basic apps/games for the nano considering the price associated with it.
    Please note I understand that there is limitation to what can be added due to the size, however I do believe that adding simple card games such as solitaire, hearts, black-jack would really enhance the product and increase customer satisfaction of the product.
    I brought this Ipod to replace my classic version with probably the same size screen(but not touch) and that came with games.

    See your other post.

  • I recently uploaded a gift card with a balance of $25.00, I make a purchase in a game for $5.99 and my balance on my gift card is now $12.18.  I did not receive an email confirming the purchase and do not see any activity on my account. Where is my money?

    I recently uploaded a gift card with a balance of $25.00, I make a purchase in a game for $5.99 and my balance on my gift card is now $12.18.  I did not receive an email confirming the purchase and do not see any activity on my account. Where did my money go? How can I get it returned??

    The receipt usually takes more time to receive. I got my receipt from about 7:00pm yesterday at about 10:00pm today.

  • Time Capsule only works for one device at a time, how to make it capable to be used for multiple devices at times

    Time Capsule only works for one device at a time, how to make it capable to be used for multiple devices at times.
    Please help to set it up, thanks in advance

    You need to give more info..
    Firstly only works for what.. networking.. backup.. wireless. You need more nouns.. more adjectives... describe what you want and what fails.. then we can figure out why.
    Most likely you have bridged it when it should be in router mode..
    Most likely you are using Lion or ML which has the airport utility bridge the TC by default.
    Change it to working as a router. That might help.
    If you press reset button it will default back to router btw.
    If you are on Lion.. use a real utility. http://support.apple.com/kb/DL1547

  • How to make an app a file receiver for images on iOS?

    Hi,
    How to make an app a file receiver for images on iOS?
    I did it for the Android app.xml like this:
    <intent-filter>
            <action android:name="android.intent.action.SEND"/>
            <category android:name="android.intent.category.DEFAULT"/>
            <data android:mimeType="text/plain"/>
        <data android:mimeType="image/jpg"/>
        <data android:mimeType="image/jpeg"/>
        <data android:mimeType="image/png"/>
        <data android:mimeType="image/gif"/>
    </intent-filter>
    How to do it for iOS?
    (I'm using Adobe Air 4.0)
    Thank you!

    What app have you used to create your ibook?  Normally any app will have a menu item like File > Export that will give you the option of PDF, or you can use Print and there will be an option in the Print dialogue to Print to PDF.

  • How to make cell editable alv in WebDynpro for ABAP?

    I make Column editable ALV.(See under source code)
    But I can't make Cell editable ALV.
    How to make Cell editable ALV in WebDynpro for ABAP?
    and..how to get changed data?
    DATA: l_value TYPE REF TO cl_salv_wd_config_table.
      l_value = l_ref_interfacecontroller->get_model( ).
    * { EDITABLE
      DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings,
            lr_input_field     TYPE REF TO cl_salv_wd_uie_input_field,
            lr_column          TYPE REF TO cl_salv_wd_column.
      lr_column_settings ?= l_value.
      lr_column = lr_column_settings->get_column( 'TOTAL_COUNT' ).
      CREATE OBJECT lr_input_field
        EXPORTING
          value_fieldname = 'TOTAL_COUNT'.
      lr_column->set_cell_editor( lr_input_field ).
      DATA: lr_table_settings TYPE REF TO if_salv_wd_table_settings.
      lr_table_settings ?= l_value.
      lr_table_settings->set_read_only( abap_false ).

    the code seems to be correct....but where are you writing it?
    put the code in the wddoinit method and it should work.
    have a look at this article..
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3133474a-0801-0010-d692-81827814a5a1

  • How to make Adobe as your default viewer for all your PDF file instead of the Preview given? Thanks

    How to make Adobe as your default viewer for all your PDF file instead of the Preview given? Thanks

    you need to "Get Info" on the file first. Select it, right click and select 'Get Info' in the menu.
    In the window that pops up, near the bottom, the "Open With" drop down menu needs changed. If the drop down menu does not present the one you want, select "Other" and find it.

  • How to make dyn/admin not to prompt for username and password?

    Hello all
    How to make dyn/admin not to prompt for username and password? I am writing a selenium job to automate cache invalidation to load test a production issue we are facing. Selenium is opening a fresh firefox session and prompting for username and password every time. I am also trying to modify my script such that it will use the same session again and not prompt for username and password. But I thought of asking this question in the group.
    Your inputs will help a lot.
    Thanks,
    Sundar

    Hi,
    You can set enabled property of /atg/dynamo/servlet/adminpipeline/AuthenticationServlet/ to false. It will not prompt for authentication.
    Gopi

  • How to make plant in shipping cond tab for line item in sales doc mandatory

    Hi
    How to make plant as mandatory for a sales document say quotation mandatory ? I went to SPRO-> Basic Fucntion - > log of incomplete terms ->  Define incomplete Groups -> B.selected sales -Item -> Created new procedure Z001 with fielda VBAP - WERKS ,selected screen name PDE2 and checked warning check box.
    When i goto Assign incompleteness procedures I donot have option to assign it sales document item level procedure i will only get sales doc header procedure to assign it to document type quotation.
    How to make plant as mandatory for each line item in quotation?
    Thanks,
    Vaishnavi

    Include: MV45AFZB
    Form  USEREXIT_CHECK_VBAP
    In our business scenario, we have used the same ,But  Plant is mandatory only for 1st line item-
    source code:
    IF vbak-vkorg = '1000' OR vbak-vkorg = '2000'.
        IF sy-tcode = 'VA31' OR
           sy-tcode = 'VA11' OR
           sy-tcode = 'VA21' OR
           sy-tcode = 'VA41' OR
           sy-tcode = 'VA01' .
          IF vbap-werks IS INITIAL AND
             vbap-posnr EQ '000010'.
            MESSAGE e398(00) WITH 'Please enter the plant for first line'.
          ENDIF.
        ENDIF.
      ENDIF.
    Help:
    Through this form exit we are making the "plant' field (for the ist  &*
    & line item ) mandatory for the sales document . This interns helps us &
    & to create the sales document numner according to the plant (Region)  &
    *& of the Plant
    Hope it clears. take assistance of your ABAPer.

  • How to make a custom template the default for Apple Mail (10.7.5)?

    Hi,
    I'm OK with making a new custom template in Apple Mail.  It shows up fine once under "custom" in the stationary pane (and once I take off signature in a new email).  But... that's a lot of trouble to go through everytime I want to send an email.
    So the question is: can I make my custom template my default for all my emails, unless I want to manually change it?  Seems like this should be possible but I can't figure it out and haven't run into any solutions (only on how to make a template).
    Do I really have to select it each time?
    Best,
    Joel

    As an FYI: I just solved the problem by going the "low road." I'll be a bit laborious in case someone else wants a solution at a later date (I know I Googled the topic and found nothing). I experimented by simply:
    Opening a new email message
    Selecting my custom template
    Copying the custom signature (Select All)
    Opening another new email message
    Selecting Edit on the Signature pulldown menu
    Hitting the plus symbol to create/add a new signature in the pane
    Pasting into the new signature
    Naming it
    Selecting "Choose signature" at the bottom of the signatures pane
    And violà!!
    It now appears as a possible selection *and* as the default.
    Better yet - it is now my default and will work as a reply to an email.
    I think I got it all right in the list above.
    OK, granted, this is a pretty simply signature - a list of my website, SoundCloud, twitter etc with those names in bold and a graphic of my color logo - but... it works! YMMV.
    Give it to Apple to make it so simple that any fool could do it (that would be me), you wouldn't need a "specialized" app, and - of course - there wouldn't even be instructions on how to do it!
    Best,
    Joel

  • Really good graphic games for iPad Mini??

    Hello, I really want to make my ipad mini's GPU and CPU work at 100%. Are there any free great graphic games for the ipad mini?

    Go to the App Store in iTunes and start searching

  • HOW TO MAKE A REVERSE VIDEO IN IMOVIE FOR IOS

    I woud like to know, if possible, in how to make a reverse video in my IPad.
    Thanks to everyone!
    G'day.

    Searched for a solution and I found a video tutorial about this:
    http://www.imoviehowto.com/imovie-ios-8-how-to-reverse-a-video-clip/

  • How to make a tabbed panel in fireworks for a web page?

    I know fireworks is not the best place to make a web page. I have to use this because it is a mockup for school. i have the tabs up and each state made in each tab i have the appropriate tab merging with the content area. I also have 3 other states I have created for each tab. first problem i am having is that when I click on state 2,3 and 4 I my content disappears including my master page and all of my other content I don't know how to make it show like it does in state 1. my second problem is I don't want to slice the hotspots to make the tabs. I just want to make the hotspots navigate to each state is that at all possible? or do I just have to slice it? the reason I don't want to slice is because the instructor does not like it when we slice content don't ask me why.

    Searched for a solution and I found a video tutorial about this:
    http://www.imoviehowto.com/imovie-ios-8-how-to-reverse-a-video-clip/

Maybe you are looking for