So, I have started to make my classic pong game and I was wondering if anyone had any suggestions as to what I should use I have uploaded the code I am using so far so any suggestions are welcome
Solved! Go to Solution.
here are some of the things I was thinking,
use the mouse arrows up and down to move the paddle.
also, make a computer AI, but first I would like to make it to where A player can choose to play another person so you would have a radio box asking player vs player and the next selection would be player vs computer.
and if it is player vs player use the keys W and S to move thier paddle.
also I figure if I set a max and min for the array I can hold the ball within those boudries so say if it hit pong it will "bounce off" the wall and this will also happen for the maximum.
Huge 2D array indicators of modern controls are relatively expensive to redraw. See how long it takes to click a button on/off or resize the front panel. I would recommend a picture indicator instead.
If you want to use a 2D array of booleans, maybe use classic controls. You should initialize the 2D array at a fixed size and keep it in a shift register. Same with the two scores.
(Your FOR loop makes no sense: You create a 1D array with one single TRUE element, replace it with a TRUE (?), and built a 1xN 2D array at the loop boundary. Why?)
Get rid of all that unecessary code. ( mostly value property nodes, etc.). Since you get the score out of the event structure, just tap into the wire going to the indicator. Same for the string indicator! All the code below and to the right of the event structure can be combined and rewritten without any value property nodes.
OK, here's a quick draft (LV 8.6) with a few suggestions on data structures and algorithms. For demonstration, the ball bounces around randomly and scores are incremented when the sides are hit. There is no user interaction.
All you need to do is add the user interaction by reading some keys to move the padles, place them also into the array, and watch for collisions. Then deflect the ball or score accordingly. 😉
Shouldn't be too difficult. 😄
Notice there are no property nodes or local variables and all operations are done on arrays if possible to keep things simple. See if it makes sense to you.
I see I created a control bool variable array and yes it is slow to redraw so I figure I will use picture varable if the array will be so slow
and I was going to put the score in the event, but right now that was not to important to me what was important is getting the programs main functions working, but because I do not know that much about the picture variable I will have to read alot on it.
here is my promo control what I want to do is make it to where the up and down buttons control the Array2
if arrray2 index is  and than you hit the down button and index is set to false and index is set to true
does this sound plasable?
I made one just for fun while i was an intern at NI, India.
What i am attaching is just an coarse vi. you can fine tune it according to your need.
Later i developed it such that it can be played by two players over LAN using shared varaibles ;).
And then even interfaced it with a Wii mote 🙂
This is just to give you a basic idea.
The speed keeps on increasing linearly, hehe, but you can always change that.
Hope you like it.
sorry i forgot to attach the vi, i tried editing the post but it was giving some unexpected error.
here is the link to it http://ujjvalshah.synthasite.com/resources/ACC%20new%20speed.vi
very cool I like it.
thank you for sharing that with me
Hey guys I am stuck on making the paddle moving in the array I know I am prolly meesing up on the for loop and the array constant, but I don't know what else I could do.
heres my code: