Galaxian Posted October 4, 2010 Share Posted October 4, 2010 Hello, I'm designing a joystick pong game and, I don't know whether it's due to my age (12) or just lack of experience but I'm having trouble. It would be much appreciated if someone could send me some source code (I understand that might be difficult). I will use it a reference only, I will NOT directly copy the whole thing. I already have started on it and it's not bad I just need to know how to make it bounce when it hits the wall of paddle. Sincerely, Galaxian Quote Link to comment Share on other sites More sharing options...
Nesbroslash Posted October 4, 2010 Share Posted October 4, 2010 Just saying, but Pong with a joystick is crappy. Maybe you should try a different peripheral. Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted October 4, 2010 Share Posted October 4, 2010 I don't think it's really all THAT crappy, have you played Off the Wall? Quote Link to comment Share on other sites More sharing options...
Galaxian Posted October 4, 2010 Author Share Posted October 4, 2010 Just saying, but Pong with a joystick is crappy. Maybe you should try a different peripheral. No no no, I doing it not for entertainment but more for learning purposes. I just think I would learn a lot and it seems relatively easy. Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted October 4, 2010 Share Posted October 4, 2010 Didn't find any Pong examples but if you check out these: http://www.atariage.com/forums/topic/109288-code-snippets-samples-for-bb-beginners/ I'm sure if you read through, compile and play with the examples above you'd be more than half-way to pong land Quote Link to comment Share on other sites More sharing options...
Galaxian Posted October 4, 2010 Author Share Posted October 4, 2010 (edited) Didn't find any Pong examples but if you check out these: http://www.atariage.com/forums/topic/109288-code-snippets-samples-for-bb-beginners/ I'm sure if you read through, compile and play with the examples above you'd be more than half-way to pong land THANK YOU! It really is appreciated, however, I have already read through it and I've taken what I have from it. On an unrelated note, I have encountered another problem. The playfield and objects haven't shown up. I'm sure there will be a VERY simple answer and I'm SO sorry if I waste you time but, here is the source code: COLUPF = 14 player0x = 30 : player0y = 44:player1x = 130 : player1y = 44 missile0height = 0 missile0x = 80 missile0y = 44 player0: %00000000 %00011000 %00011000 %00011000 %00011000 %00011000 %00000000 end player1: %00000000 %00011000 %00011000 %00011000 %00011000 %00011000 %00000000 end playfield: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX end mainloop colup0 = 14 colup1 = 14 drawscreen if joy0up then player0y=player0y+2 if joy0down then player0y=player0y-2 if joy1up then player1y=player1y+2 if joy1down then player1y=player1y-2 if collision (missile0,player0) then AUDV0=15 AUDC0=4 AUDF0=13 musictimer=30 if collision (missile0,player1) then AUDV0=15 AUDC0=4 AUDF0=13 musictimer=30 Edited October 4, 2010 by Galaxian Quote Link to comment Share on other sites More sharing options...
RevEng Posted October 4, 2010 Share Posted October 4, 2010 (edited) A few things I see at first glance... colup0 and colup1 should be COLUP0 and COLUP1 you were missing a "goto mainloop" at the end if statements don't work over multiple lines in bB COLUPF = 14 player0x = 30 : player0y = 44:player1x = 130 : player1y = 44 missile0height = 0 missile0x = 80 missile0y = 44 player0: %00000000 %00011000 %00011000 %00011000 %00011000 %00011000 %00000000 end player1: %00000000 %00011000 %00011000 %00011000 %00011000 %00011000 %00000000 end playfield: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX end mainloop COLUP0 = 14 COLUP1 = 14 drawscreen if joy0up then player0y=player0y+2 if joy0down then player0y=player0y-2 if joy1up then player1y=player1y+2 if joy1down then player1y=player1y-2 if collision (missile0,player0) then AUDV0=15:AUDC0=4:AUDF0=13:musictimer=30 if collision (missile0,player1) then AUDV0=15:AUDC0=4:AUDF0=13:musictimer=30 goto mainloop I don't have the opportunity to try it out, but I think that should work. Edited October 4, 2010 by RevEng Quote Link to comment Share on other sites More sharing options...
Impaler_26 Posted October 4, 2010 Share Posted October 4, 2010 Here are two threads with source-code for bB-Pong games, hope it helps: Pong Kombat Atari 2600 GUI Quote Link to comment Share on other sites More sharing options...
accousticguitar Posted October 4, 2010 Share Posted October 4, 2010 Here is some source code for Pong: http://www.atariage.com/forums/topic/126576-latest-homebrew-bong/ Quote Link to comment Share on other sites More sharing options...
Galaxian Posted October 4, 2010 Author Share Posted October 4, 2010 (edited) That's REALLY, REALLY good of you guys, but this game is my first one, so I have NO idea what half of those commands mean. Also, I have encountered yet another problem, when I go to compile the game, it comes up with the following error message: (52): Error: Unknown keyword: player0 Here is the source (yet again): COLUPF = 14 player0x = 30 : player0y = 44:player1x = 130 : player1y = 44 missile0height = 0 missile0x = 80 missile0y = 44 player0: %00000000 %00011000 %00011000 %00011000 %00011000 %00011000 %00000000 end player1: %00000000 %00011000 %00011000 %00011000 %00011000 %00011000 %00000000 end playfield: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX end mainloop AUDV0 = 15 COLUP0 = 14 COLUP1 = 14 drawscreen if joy0up then player0y=player0y+2 if joy0down then player0y=player0y-2 if joy1up then player1y=player1y+2 if joy1down then player1y=player1y-2 if collision (missile0,player0) then AUDC0=4:AUDF0=13:musictimer=30 if collision (missile0,player1) then AUDC0=4:AUDF0=13:musictimer=30 goto mainloop Thank you SOOO much for all your effort! (Don't worry, the "end" and "mainloop" aren't spaced) Edited October 4, 2010 by Galaxian Quote Link to comment Share on other sites More sharing options...
TooSlowGamer Posted October 4, 2010 Share Posted October 4, 2010 The error that comes up is due to a lack of spaces before certain lines. If you're using visualbB, you could keep things simple by going through and clicking on the end of each line, pressing enter, then hitting delete. When you type a line of code in VbB, make sure you press enter after it, then delete the tab down if needed. Quote Link to comment Share on other sites More sharing options...
Galaxian Posted October 4, 2010 Author Share Posted October 4, 2010 The error that comes up is due to a lack of spaces before certain lines. If you're using visualbB, you could keep things simple by going through and clicking on the end of each line, pressing enter, then hitting delete. When you type a line of code in VbB, make sure you press enter after it, then delete the tab down if needed. Thank you, do you know which lines? Quote Link to comment Share on other sites More sharing options...
BDW Posted October 4, 2010 Share Posted October 4, 2010 Just saying, but Pong with a joystick is crappy. Maybe you should try a different peripheral. Pong is fine on a joystick, I've played Video Olympics on the Atari Plug n' Play Joystick and it was ok. Quote Link to comment Share on other sites More sharing options...
Galaxian Posted October 4, 2010 Author Share Posted October 4, 2010 Alright, so I have downloaded VisualbB and have used it, however when I go to run it, it just has flickering lights! default.bas.bin default.bas Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted October 4, 2010 Share Posted October 4, 2010 There might be some problems with indentation. Especially check out how yer sprites and playfields indentation differs from the examples. Also, remember your set romsize and set kernel_options lines at the very beginning. Quote Link to comment Share on other sites More sharing options...
Galaxian Posted October 4, 2010 Author Share Posted October 4, 2010 There might be some problems with indentation. Especially check out how yer sprites and playfields indentation differs from the examples. Also, remember your set romsize and set kernel_options lines at the very beginning. Okay, I've done that. However, something is wrong with my set romsize 4k syntax. default.bas Quote Link to comment Share on other sites More sharing options...
accousticguitar Posted October 4, 2010 Share Posted October 4, 2010 This one works. You needed a background color and you also needed to name a variable for musictimer. Joypong2.bas Quote Link to comment Share on other sites More sharing options...
Galaxian Posted October 5, 2010 Author Share Posted October 5, 2010 Ok, that's all problems solved (thanks) except how to make the ball bounce... If you could offer me your expertise, it would be invaluable to my learning! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.