+Random Terrain Posted December 1, 2012 Share Posted December 1, 2012 Have you looked at this section of the bB page yet: http://www.randomter...tml#pfscorebars You might notice that something is missing from your code after reading the first paragraph. Quote Link to comment Share on other sites More sharing options...
Rabbit 2600 Posted December 1, 2012 Author Share Posted December 1, 2012 (edited) Ah yes! How silly of me, thanks for pointing that out =) This is very hard, I don't really know what too add, but tell me, am I on the right track? I wrote this up in my program, still can't get anything too happen: const pfscore=1 pfscore1=%10101010 player0x=70 : player0y = 50 : player1x = 86 : player1y = 50 pfscore1=%10101010 player0: %10101010 end Not sure if I need the debounce? Edited December 1, 2012 by Rabbit 2600 Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted December 1, 2012 Share Posted December 1, 2012 Attach your latest .bas file or .txt file and I'll grab it. If you don't know how to attach files, take a look at this: How to Attach Files and Images Quote Link to comment Share on other sites More sharing options...
Rabbit 2600 Posted December 2, 2012 Author Share Posted December 2, 2012 Here it is - Dragon Slayer.bas 1 Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted December 3, 2012 Share Posted December 3, 2012 Try this: dragon_slayer_2012y_12m_03d_1122t.bin dragon_slayer_2012y_12m_03d_1122t.bas Quote Link to comment Share on other sites More sharing options...
Rabbit 2600 Posted December 4, 2012 Author Share Posted December 4, 2012 Ahh, now I understand how it works! That was so simple, why did I make it so complicated, haha XD Many thanks for this one! Quote Link to comment Share on other sites More sharing options...
Rabbit 2600 Posted December 4, 2012 Author Share Posted December 4, 2012 Let's see if I can come up with this code on my own: When the pfscore1 reaches 0 I wish the game to be reseted. So I wrote this up but I get a syntax error. Am I on the right track, or am I way off? =) if pfscore1 = pfscore 0/4 then reboot Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted December 4, 2012 Share Posted December 4, 2012 Let's see if I can come up with this code on my own: When the pfscore1 reaches 0 I wish the game to be reseted. So I wrote this up but I get a syntax error. Am I on the right track, or am I way off? =) if pfscore1 = pfscore 0/4 then reboot You never want to use reboot because it makes random numbers not so random anymore. You probably want to use something like this: if pfscore1 = 0 then goto __Start_Restart Quote Link to comment Share on other sites More sharing options...
Rabbit 2600 Posted December 4, 2012 Author Share Posted December 4, 2012 Ahhh, I didn't know that rebooting messed up the random numbers. I wasn't that far from using the correct code this time, was I? I think I'm learning quite fast^^ Quote Link to comment Share on other sites More sharing options...
Rabbit 2600 Posted December 4, 2012 Author Share Posted December 4, 2012 Now, if I want the player to progress too the next screen after picking up 3 balls, how would I go about that? I thought something like if score = 50 then goto screen2 would work for example, but it did not. Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted December 4, 2012 Share Posted December 4, 2012 Now, if I want the player to progress too the next screen after picking up 3 balls, how would I go about that? I thought something like if score = 50 then goto screen2 would work for example, but it did not. If you use the Index on the right side of the bB page, you can hop to places on the page that can help you. For example, if you scroll down to score and click on it, you'll jump here: www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#score Once there, scroll down to the paragraph that starts with "If you plan to check the score, you will need to break out its 6 digits . . ." Quote Link to comment Share on other sites More sharing options...
Rabbit 2600 Posted December 4, 2012 Author Share Posted December 4, 2012 Ahh, neat! Cheers! Quote Link to comment Share on other sites More sharing options...
Rabbit 2600 Posted December 4, 2012 Author Share Posted December 4, 2012 Okay, I think I managed to fix it. Now, when I want the new screen too start, I guess I'll have too set player movement and all the other things for that screen aswell? Quote Link to comment Share on other sites More sharing options...
Rabbit 2600 Posted December 4, 2012 Author Share Posted December 4, 2012 Another question: I tried implementing animated enemies. I wrote this code, but the enemies turn invisible, how come? rem **************************************************************** rem * rem * Enemy sprite data. rem * rem ```````````````````````````````````````````````````````````````` rem ` if f=10 then player1: %00011000 %00111100 %00011000 %01111110 %11111111 %00011000 %10011000 %01110000 end if f=20 then player1: %00011000 %00111100 %00011000 %00111100 %01111110 %10011001 %00011000 %11110000 end Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted December 5, 2012 Share Posted December 5, 2012 Another question: I tried implementing animated enemies. I wrote this code, but the enemies turn invisible, how come? I'd have to see your latest attached .bas file. Quote Link to comment Share on other sites More sharing options...
Rabbit 2600 Posted December 5, 2012 Author Share Posted December 5, 2012 Alright - dragon_slayer_2012y_12m_03d_1122t.bas When you upload it could you do it in code? My temp folder is corrupted so I can't download files anymore. I need too reinstall windows and fix everything someday. Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted December 5, 2012 Share Posted December 5, 2012 When you upload it could you do it in code? My temp folder is corrupted so I can't download files anymore. I need too reinstall windows and fix everything someday. Have you gone Googling for a fix? Pretty much every answer to any problem I've ever had was found through a Google search or by asking in the Computers, Science & Technology forum. Quote Link to comment Share on other sites More sharing options...
Rabbit 2600 Posted December 5, 2012 Author Share Posted December 5, 2012 Yeah, I've tried everything I could find. I believe it might be a virus. Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted December 5, 2012 Share Posted December 5, 2012 Yeah, I've tried everything I could find. I believe it might be a virus. I use the free versions of Avast and Comodo Firewall. Are you using something similar? Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted December 5, 2012 Share Posted December 5, 2012 The reason why that code you posted didn't work was because you didn't have it in your main loop. Even if you would have put it in your main loop, you needed to have the variable count up, as in f = f +1. Then you needed an if-then to make the variable go back to zero again. Here is the latest: dragon_slayer_2012y_12m_05d_0827t.bin dragon_slayer_2012y_12m_05d_0827t.bas You should try to get an antivirus program that will work on your PC as soon as possible because your program is only going to get larger and it will end up taking up a full page before long: set tv pal set romsize 4k rem **************************************************************** rem **************************************************************** rem * rem * Fixes it so "then goto" is usually unnecessary. rem * set smartbranching on rem **************************************************************** rem **************************************************************** rem * rem * Create aliases for variables. rem * rem **************************************************************** rem ` rem ` (You can have more than one alias for each variable.) rem ` rem ```````````````````````````````````````````````````````````````` rem ```````````````````````````````````````````````````````````````` rem ` rem ` Enemy Animation Counter rem ` rem ```````````````````````````````````````````````````````````````` rem ` dim _Enemy_Anim_Counter = f rem ```````````````````````````````````````````````````````````````` rem ```````````````````````````````````````````````````````````````` rem ` rem ` BitOp variables 01 (controls all 8 bits). rem ` rem ```````````````````````````````````````````````````````````````` rem ` dim _BitOp_01 = q rem ```````````````````````````````````````````````````````````````` rem ` rem ` Debounce fire button (first of 8 bits). rem ` rem ```````````````````````````````````````````````````````````````` rem ` dim _Bit0_Debounce_Fire = q rem ```````````````````````````````````````````````````````````````` rem ` rem ` Debounce reset switch (second of 8 bits). rem ` rem ```````````````````````````````````````````````````````````````` rem ` dim _Bit1_Debounce_Reset = q rem ```````````````````````````````````````````````````````````````` rem ` Makes better random numbers. rem ` rem ```````````````````````````````````````````````````````````````` rem ` dim rand16 = z rem **************************************************************** rem **************************************************************** rem * rem * Enable pfscore bars. rem * rem **************************************************************** rem * const pfscore=1 rem **************************************************************** rem **************************************************************** rem * rem * rem * Program Start/Restart rem * rem * Clears and sets up variables (among other things). rem * rem * rem **************************************************************** rem **************************************************************** __Start_Restart rem **************************************************************** rem * rem * Clears most variables, except for z. rem * rem ```````````````````````````````````````````````````````````````` rem ` for temp5 = 0 to 24 : a[temp5] = 0 : next rem **************************************************************** rem * rem * Makes sure sprites are off the screen. rem * rem ```````````````````````````````````````````````````````````````` rem ` player0y = 255 : player1y = 255 rem **************************************************************** rem * rem * Missile setup. rem * rem ```````````````````````````````````````````````````````````````` rem ` missile0height = 4 : missile0y = 255 missile1height = 4 : missile1y = 255 rem **************************************************************** rem * rem * Ball setup. rem * rem ```````````````````````````````````````````````````````````````` rem ` ballheight = 4 : ballx = 255 : bally = 255 CTRLPF = $21 rem **************************************************************** rem * rem * Score setup. rem * rem ```````````````````````````````````````````````````````````````` rem ` score = 0 : scorecolor = $20 rem **************************************************************** rem * rem * Misc. setup. rem * rem ```````````````````````````````````````````````````````````````` rem ` NUSIZ0 = $00 m = 0 rem **************************************************************** rem * rem * Title screen playfield data. rem * rem ```````````````````````````````````````````````````````````````` rem ` playfield: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX X..............................X X...XXXXX.XXX.XXXXX.X....XXXX..X X.....X....X....X...X....X.....X X.....X....X....X...X....X.....X X.....X....X....X...X....XXX...X X.....X....X....X...X....X.....X X.....X....X....X...X....X.....X X.....X...XXX...X...XXXX.XXXX..X X..............................X XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX end rem **************************************************************** rem * rem * Player sprite data. rem * rem ```````````````````````````````````````````````````````````````` rem ` player0: %01100110 %00100100 %00100100 %01011000 %01011000 %00100111 %00011000 %00011000 end rem **************************************************************** rem * rem * Enemy sprite data. rem * rem ```````````````````````````````````````````````````````````````` rem ` player1: %00010100 %01011101 %00101010 %00011100 %01111111 %00011100 %00111110 %01000001 end __Title_Screen_Loop rem **************************************************************** rem * rem * Playfield colors. rem * rem ```````````````````````````````````````````````````````````````` rem ` COLUBK = 0 : COLUPF = $30 rem **************************************************************** rem * rem * Draws the screen. rem * rem ```````````````````````````````````````````````````````````````` rem ` drawscreen rem **************************************************************** rem * rem * If fire button pressed, leave title screen loop. rem * rem ```````````````````````````````````````````````````````````````` rem ` if joy0fire || joy1fire then goto __Setup_for_Main_Loop goto __Title_Screen_Loop __Setup_for_Main_Loop rem **************************************************************** rem * rem * Turns on debounce bits. rem * rem ```````````````````````````````````````````````````````````````` rem ` _Bit0_Debounce_Fire{0} = 1 _Bit1_Debounce_Reset{1} = 1 rem **************************************************************** rem * rem * Puts sprites on the screen. rem * rem ```````````````````````````````````````````````````````````````` rem ` player0x = 75 : player0y = 85 player1x = (rand/2) + 20 : player1y = 0 rem **************************************************************** rem * rem * Sets up number of lives. rem * rem ```````````````````````````````````````````````````````````````` rem ` pfscore1 = %10101010 rem **************************************************************** rem * rem * Game playfield data. rem * rem ```````````````````````````````````````````````````````````````` rem ` playfield: X..............................X X..............................X X..............................X X..............................X X..............................X X..............................X X..............................X X..............................X X..............................X X..............................X X..............................X end rem **************************************************************** rem **************************************************************** rem * rem * rem * Main Loop rem * rem * rem **************************************************************** rem **************************************************************** __Main_Loop rem **************************************************************** rem * rem * Sets colors. rem * rem ```````````````````````````````````````````````````````````````` rem ` COLUP1 = $52 : COLUP0 = $06 COLUPF = $40 : COLUBK = $00 pfscorecolor = $06 rem **************************************************************** rem * rem * Draws the screen. rem * rem ```````````````````````````````````````````````````````````````` rem ` drawscreen rem **************************************************************** rem * rem * Enemy sprite animation data. rem * rem ```````````````````````````````````````````````````````````````` rem ` _Enemy_Anim_Counter = _Enemy_Anim_Counter + 1 if _Enemy_Anim_Counter = 10 then player1: %00011000 %00111100 %00011000 %01111110 %11111111 %00011000 %10011000 %01110000 end if _Enemy_Anim_Counter = 20 then player1: %00011000 %00111100 %00011000 %00111100 %01111110 %10011001 %00011000 %11110000 end if _Enemy_Anim_Counter = 20 then _Enemy_Anim_Counter = 0 rem **************************************************************** rem * rem * Debounce fire button. rem * rem ```````````````````````````````````````````````````````````````` rem ` rem ` If fire button not pressed, clear debounce bit. rem ` if !joy0fire then _Bit0_Debounce_Fire{0} = 0 if score = 50 then goto __Boss_Loop rem **************************************************************** rem * rem * Restarts game when 1-ups are depleted.. rem * rem ```````````````````````````````````````````````````````````````` rem ` if pfscore1 = 0 then goto __Start_Restart rem **************************************************************** rem * rem * If enemy and player position are the same, restart enemy. rem * rem ```````````````````````````````````````````````````````````````` rem ` if player1y = player0y then player1x = (rand/2) + 20 : player1y = 0 rem **************************************************************** rem * rem * Check enemy missile. rem * rem ```````````````````````````````````````````````````````````````` rem ` rem ` If enemy missile isn't on or has gone too far, skip. rem ` rem ```````````````````````````````````````````````````````````````` rem ` if missile1y > 200 then goto __Skip_Enemy_Missile_Movement rem ```````````````````````````````````````````````````````````````` rem ` rem ` Move enemy missile down the screen and skip enemy fire. rem ` rem ```````````````````````````````````````````````````````````````` rem ` missile1y = missile1y + 2 : goto __Skip_Enemy_Fire __Skip_Enemy_Missile_Movement rem ```````````````````````````````````````````````````````````````` rem ` rem ` If enemy missile isn't moving, randomly put the missile on rem ` the screen (fire missile). rem ` rem ```````````````````````````````````````````````````````````````` rem ` if rand < 100 then missile1y = player1y : missile1x = player1x + 4 __Skip_Enemy_Fire rem **************************************************************** rem * rem * Check player missile. rem * rem ```````````````````````````````````````````````````````````````` rem ` rem ` If player missile isn't on or has gone too far, skip. rem ` rem ```````````````````````````````````````````````````````````````` rem ` if missile0y > 240 then goto __Skip_Missile_Movement rem ```````````````````````````````````````````````````````````````` rem ` rem ` Move player missile up the screen and skip fire button. rem ` rem ```````````````````````````````````````````````````````````````` rem ` missile0y = missile0y - 2 : goto __Skip_Fire __Skip_Missile_Movement rem ```````````````````````````````````````````````````````````````` rem ` rem ` If player missile isn't moving and fire button is pressed rem ` and debounce bit is not on, put the missile on the screen rem ` (fire missile). rem ` rem ```````````````````````````````````````````````````````````````` rem ` if joy0fire && !_Bit0_Debounce_Fire{0} then missile0y = player0y - 2 : missile0x = player0x + 4 __Skip_Fire rem **************************************************************** rem * rem * Check Enemy. rem * rem ```````````````````````````````````````````````````````````````` rem ` rem ` If enemy isn't on or has gone too far, skip. rem ` rem ```````````````````````````````````````````````````````````````` rem ` if player1y > 200 then goto __Skip_Player1_Movement rem ```````````````````````````````````````````````````````````````` rem ` rem ` Move enemy down the screen and skip new ball drop. rem ` rem ```````````````````````````````````````````````````````````````` rem ` player1y = player1y + 1 : goto __Skip_Player1_Drop __Skip_Player1_Movement rem ```````````````````````````````````````````````````````````````` rem ` rem ` If enemy isn't moving, randomly drop ball. rem ` rem ```````````````````````````````````````````````````````````````` rem ` if rand < 50 then player1x = (rand/2) + 22 : player1y = 0 : if player1x > 114 then player1x = 114 - (rand/4) __Skip_Player1_Drop rem **************************************************************** rem * rem * Check ball. rem * rem ```````````````````````````````````````````````````````````````` rem ` rem ` If ball isn't on or has gone too far, skip. rem ` rem ```````````````````````````````````````````````````````````````` rem ` if bally > 200 then goto __Skip_Ball_Movement rem ```````````````````````````````````````````````````````````````` rem ` rem ` Move ball down the screen and skip new ball drop. rem ` rem ```````````````````````````````````````````````````````````````` rem ` bally = bally + 1 : goto __Skip_Ball_Drop __Skip_Ball_Movement rem ```````````````````````````````````````````````````````````````` rem ` rem ` If ball isn't moving, randomly drop ball. rem ` rem ```````````````````````````````````````````````````````````````` rem ` if rand < 50 then ballx = (rand/2) + 22 : bally = 0 : if ballx > 114 then ballx = 114 - (rand/4) __Skip_Ball_Drop rem **************************************************************** rem * rem * If player missile hit enemy, add to score and reset enemy. rem * rem ```````````````````````````````````````````````````````````````` rem ` if collision(missile0,player1) then score=score + 10 : player1x = (rand/2) + 20 : player1y = 0 : missile0y=255 rem **************************************************************** rem * rem * If player touches enemy, subtract from score and reset enemy. rem * rem ```````````````````````````````````````````````````````````````` rem ` if collision(player0,player1) then player1x = (rand/2) + 20 : player1y = 0 : pfscore1 = pfscore1/4 rem **************************************************************** rem * rem * If enemy missile hits player, subtract from score and reset rem * missile. rem * rem ```````````````````````````````````````````````````````````````` rem ` if collision(missile1,player0) then missile1y=255 : pfscore1 = pfscore1/4 rem **************************************************************** rem * rem * If ball touches player, subtract from score and remove ball. rem * rem ```````````````````````````````````````````````````````````````` rem ` if collision(player0,ball) then bally = 255 : pfscore1 = pfscore1/4 rem **************************************************************** rem * rem * If ball touches missile, remove missile. rem * rem ```````````````````````````````````````````````````````````````` rem ` if collision(missile0,ball) then missile0y = 255 rem **************************************************************** rem * rem * REMed out playfield collision since it's only being used to rem * keep the player from going too far left or right. rem * rem ```````````````````````````````````````````````````````````````` rem ` rem if !collision(player0,playfield) then goto __Skip_PF_Collision rem if m = 1 then player0y = player0y + 1 : goto __Skip_Move rem if m = 2 then player0x = player0x + 1 : goto __Skip_Move rem if m = 3 then player0y = player0y - 1 : goto __Skip_Move rem if m = 4 then player0x = player0x - 1 : goto __Skip_Move rem goto __Skip_Move __Skip_PF_Collision rem **************************************************************** rem * rem * If joystick moved left, do that and point player that way. rem * rem ```````````````````````````````````````````````````````````````` rem ` if joy0left then player0x = player0x - 1 : REFP0 = 8 : m = 2 : goto __Skip_Move rem **************************************************************** rem * rem * If joystick moved right, do that and point player that way. rem * rem ```````````````````````````````````````````````````````````````` rem ` if joy0right then player0x = player0x + 1 : m = 4 : REFP0 = 0 : goto __Skip_Move __Skip_Move rem **************************************************************** rem * rem * Keep the player from going too far left or right. rem * rem ```````````````````````````````````````````````````````````````` rem ` if player0x > 134 then player0x = 134 if player0x < 20 then player0x = 20 rem **************************************************************** rem * rem * Reset Program: rem * rem * Any Atari 2600 program should restart when the reset switch rem * is pressed. It is part of the usual standards and procedures. rem * rem ```````````````````````````````````````````````````````````````` rem ` if !switchreset then _Bit1_Debounce_Reset{1} = 0 : goto __Skip_Reset rem ```````````````````````````````````````````````````````````````` rem ` If Reset is pressed, but debounce bit is on, skip. rem ` if _Bit1_Debounce_Reset{1} then goto __Skip_Reset rem ```````````````````````````````````````````````````````````````` rem ` Reset the program. rem ` goto __Start_Restart __Skip_Reset goto __Main_Loop __Boss_Loop __Boss playfield: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX X..............................X X..............................X X..............................X X..............................X X..............................X X..............................X X..............................X X..............................X XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX X..............................X end drawscreen goto __Boss_Loop rem **************************************************************** rem * rem * Game Over screen playfield data. rem * rem ```````````````````````````````````````````````````````````````` rem ` __Game_Over playfield: ......XXXX..X...X.X..XXXX....... ......X....X.X.X.X.X.X.......... ......X.XX.XXX.X.X.X.XXXX....... ......X..X.X.X.X.X.X.X.......... ......XXXX.X.X.X.X.X.XXXX....... ................................ .......XX..X..X.XXXX.XXX........ ......X..X.X..X.X....X..X....... ......X..X.X..X.XXXX.XXX........ ......X..X..X.X.X....X..X....... .......XX....X..XXXX.X..X....... end Quote Link to comment Share on other sites More sharing options...
Rabbit 2600 Posted December 5, 2012 Author Share Posted December 5, 2012 Ahh, I understand. Thanks! So I'll have too put all functions in the main loop then? Yeah, I use Spyware Doctor. i'm going to reinstall windows hopefully tomorrow and clear everything up. Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted December 5, 2012 Share Posted December 5, 2012 Ahh, I understand. Thanks! So I'll have too put all functions in the main loop then? Yeah, I use Spyware Doctor. i'm going to reinstall windows hopefully tomorrow and clear everything up. Going by the name, it sounds like it does nothing for viruses. Quote Link to comment Share on other sites More sharing options...
Rabbit 2600 Posted December 5, 2012 Author Share Posted December 5, 2012 It does remove viruses, despite it's name. Best antivirus software I ever had, but no program is perfect =) Thanks to you Random, my game is taking shape, I've learned a ton! With the help of your code of animating the enemy I understood how it worked and I managed too animate the player sprite aswell =) Now, I have yet another question about omplementing sound. I can get a tone but it loops all the time. Can sound effects be made with the same setup of dims? Only difference being it activates when the player missile collides with the enemy? Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted December 5, 2012 Share Posted December 5, 2012 It does remove viruses, despite it's name. Best antivirus software I ever had, but no program is perfect =) I'd rather use Avast or Microsoft Security Essentials. Now, I have yet another question about omplementing sound. I can get a tone but it loops all the time. Can sound effects be made with the same setup of dims? Only difference being it activates when the player missile collides with the enemy? After you get rid of the virus, check out this post: http://www.atariage.com/forums/topic/206072-insane-invaders-wip-plus-introduction/#entry2652376 You guys are basically making the same game, so you are doing similar things. Quote Link to comment Share on other sites More sharing options...
Rabbit 2600 Posted December 5, 2012 Author Share Posted December 5, 2012 Ahh, neat. Cheers =) 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.