-
Content Count
979 -
Joined
-
Last visited
-
Days Won
1
Content Type
Profiles
Member Map
Forums
Blogs
Gallery
Calendar
Store
Everything posted by Lodmot
-
I actually just use my harmony cart for either prototypes, really rare games, games that I have made and finished, or Ill also use it while I'm working on a game if I wanna test it on a real system instead of the emulator.
-
Midnight Magic
-
I have to agree there. It's not only awesome getting a brand new game for an old system, but I love making games for the 2600. It's such an awesome sensation seeing a game I made being played on a 30 year old machine.
-
I've been wondering this for a bit of time now... What's more valuable? Homebrew games with a limited production run or rare official releases? Or does it not matter?
-
@Fred Garvin Sweet! Dude, yours has a pretty low serial number.
-
Ah, okay. So it's like the TIA values, in that SWCHA can't be read.
-
Yeah, but technically in this case we're not using "&&" xD SWCHA uses a single & sign. Not sure if that makes a difference, but I just noticed that and thought it was interesting. Also... However here we're not using "on.... goto" so maybe that doesn't apply.
-
I tried that in Visual BB but it didn't work.. I also tried getting rid of the "else" portion of the sentence and that didn't work either. There must be something wrong with either my compiler or the version of Visual BB that I'm using.
-
Assuming I got the if right, that should add 4 to the acceleration whenever the joystick is pushed in any of the four directions, or set the resistance to 0 if the joystick is *not* being pushed in any direction. Yes, that's correct. ^^ I tried the code you suggested, and it gave an error. But thank you for trying anyway. Maybe we have different versions of the compiler or something, because judging by the guide on RT's site, your suggestion looks like it should work
-
I tried that line of code, and it gave an error... o.o;
-
Thank you for the suggestions SeaGtGruff, I think they'll work with what I'm doing here. ^^ There's 3 cars in the game. I spent about 3 to 4 hours going through the entire code and optimizing whatever I could, and I got it to the point where two cars can move around and shoot at the same time with it just barely reaching 263 scanlines, but there's still room for improvement when the 3rd car is added to the mix (which makes it run at about 274, give or take). I'm using the multisprite kernel, so I'll be pretty limited to how much I can do in the vblank. I'm not sure how much space the multikernel gives there. Also I tried replacing: if joy0right then P1_Acceleration=P1_Acceleration+4 if joy0up then P1_Acceleration=P1_Acceleration+4 if joy0down then P1_Acceleration=P1_Acceleration+4 if joy0left then P1_Acceleration=P1_Acceleration+4 with this: if !joy0up && !joy0down && !joy0left && !joy0right then P1_Resistance=0 else P1_Acceleration=P1_Acceleration+4
-
Very early WIP of something I've been working on for ages...
Lodmot replied to eshu's topic in Atari 2600 Programming
HOLY SHIT! You, my friend, are God. -
Well, what I'm trying to do exactly is make a car game that has physics (obviously). In the physics engine here, I have two directional variables, one is the direction the car is facing, and another is resistance direction, which allows the car to swerve around a corner if it turns while it's at full throttle. Then I have the velocity variable which is always adding up by 1's till it gets to 100 at which it loops back to 0. When you press right, left, up or down on the joystick, an acceleration variable adds up by 4, and maxes out at 100. At the same time, it will also set the velocity value to the value of the acceleration variable. This is to make it so the higher the velocity value is, the sooner it gets to 100. The velocity variable then reads the acceleration variable and detects whether it's higher than 100, and if so, it moves the car one pixel in the corresponding direction. If you let go of the joystick, I have that variable decrease by 1 until it gets back to 0, allowing for the car to keep momentum for a period of time. I'm not sure if that's EXACTLY how it works... It's extremely confusing even for me, even though I wrote it... It took me a while to get it to do exactly what I wanted it to do. xD
-
Alright, so I gave a crack at optimizing my code. This is really just way too confusing for me to even figure out. Right now the code looks like this: __Physics_P1 rem PLAYER 1 CAR PHYSICS rem Calculate Car Acceleration and move car accordingly if P1_Health=0 then P1_Acceleration=0 if P1_Acceleration<=75 then P1_Velocity=P1_Velocity+P1_Acceleration if P1_Acceleration>75 then P1_Velocity=P1_Velocity+P1_Acceleration/2 if !switchleftb && P1_Acceleration=100 then P1_Velocity=101 if P1_Velocity>100 && P1_Acceleration>75 then P1_Velocity=100 : P1_Speed1=1 : P1_Speed2=1 if P1_Velocity>100 && P1_Acceleration<=75 then P1_Velocity=100 : P1_Speed1=0 : P1_Speed2=1 if joy0right then P1_Acceleration=P1_Acceleration+4 if joy0up then P1_Acceleration=P1_Acceleration+4 if joy0down then P1_Acceleration=P1_Acceleration+4 if joy0left then P1_Acceleration=P1_Acceleration+4 if P1_Acceleration>0 then P1_Acceleration=P1_Acceleration-1 if P1_Acceleration<1 then P1_Acceleration=0 if P1_Acceleration>100 then P1_Acceleration=100 : P1_Resistance=0 if P1_Acceleration=100 then P1_Speed1=1 : P1_Speed2=1 if P1_Acceleration=0 then P1_Velocity=0 if P1_Velocity<100 then P1_Speed1=0 : P1_Speed2=0 if P1_Velocity=100 then P1_Velocity=0 if !joy0up && !joy0down && !joy0left && !joy0right then P1_Resistance=0 if !P1_Direction1 && P1_Speed2 then goto 694 else goto 698 694 if P1_Direction2 && P1_Speed1 then player0x=player0x+2 if P1_Direction2 && !P1_Speed1 then player0x=player0x+1 if !P1_Direction2 && P1_Speed1 then player0y=player0y-2 if !P1_Direction2 && !P1_Speed1 then player0y=player0y-1 698 if P1_Direction1 && P1_Speed2 then 699 else 707 699 if !P1_Direction2 && P1_Speed1 then player0x=player0x-2 if !P1_Direction2 && !P1_Speed1 then player0x=player0x-1 if P1_Direction2 && P1_Speed1 then player0y=player0y+2 if P1_Direction2 && !P1_Speed1 then player0y=player0y+1 rem Decrease carspeed when the opposite directional key is pressed while the car is moving 707 if P1_Acceleration<=1 then 714 if !P1_Direction1 && P1_Direction2 && joy0left then P1_Acceleration=P1_Acceleration-6 if !P1_Direction1 && !P1_Direction2 && joy0up then P1_Acceleration=P1_Acceleration-6 if P1_Direction1 && !P1_Direction2 && joy0right then P1_Acceleration=P1_Acceleration-6 if P1_Direction1 && P1_Direction2 && joy0down then P1_Acceleration=P1_Acceleration-6 rem Check whether car's acceleration is being resisted or not 714 if P1_Acceleration>60 then 720 if P1_Acceleration<=60 && joy0right then P1_Direction1=0 : P1_Direction2=1 if P1_Acceleration<=60 && joy0down then P1_Direction1=0 : P1_Direction2=0 if P1_Acceleration<=60 && joy0left then P1_Direction1=1 : P1_Direction2=0 if P1_Acceleration<=60 && joy0up then P1_Direction1=1 : P1_Direction2=1 goto 728 720 if P1_Direction1 && P1_Direction2 && joy0right then P1_Acceleration=0 : P1_Direction1=0 : P1_Direction2=1 : P1_Resistance=4 if !P1_Direction1 && !P1_Direction2 && joy0right then P1_Acceleration=0 : P1_Direction1=0 : P1_Direction2=1 : P1_Resistance=2 if P1_Direction1 && P1_Direction2 && joy0left then P1_Acceleration=0 : P1_Direction1=1 : P1_Direction2=0 : P1_Resistance=4 if !P1_Direction1 && !P1_Direction2 && joy0left then P1_Acceleration=0 : P1_Direction1=1 : P1_Direction2=0 : P1_Resistance=2 if P1_Direction1 && !P1_Direction2 && joy0up then P1_Acceleration=0 : P1_Direction1=1 : P1_Direction2=1 : P1_Resistance=3 if !P1_Direction1 && P1_Direction2 && joy0up then P1_Acceleration=0 : P1_Direction1=1 : P1_Direction2=1 : P1_Resistance=1 if P1_Direction1 && !P1_Direction2 && joy0down then P1_Acceleration=0 : P1_Direction1=0 : P1_Direction2=0 : P1_Resistance=3 if !P1_Direction1 && P1_Direction2 && joy0down then P1_Acceleration=0 : P1_Direction1=0 : P1_Direction2=0 : P1_Resistance=1 728 if P1_Resistance=1 then player0x=player0x+1 if P1_Resistance=2 then player0y=player0y-1 if P1_Resistance=3 then player0x=player0x-1 if P1_Resistance=4 then player0y=player0y+1 if player1y<98 then goto __Physics_A1 bank4 __Physics_A1 rem AI1 CAR PHYSICS rem Calculate Car AI1 Acceleration and move car accordingly if Car2_Health=0 then AI1_IsAccel=0 if Car2_Acceleration<=75 then Car2_Velocity=Car2_Velocity+Car2_Acceleration else Car2_Velocity=Car2_Velocity+Car2_Acceleration/2 if !switchleftb && Car2_Acceleration=100 then Car2_Velocity=101 if Car2_Velocity>100 && Car2_Acceleration>75 then Car2_Velocity=100 : Car2_Speed1=1 : Car2_Speed2=1 if Car2_Velocity>100 && Car2_Acceleration<=75 then Car2_Velocity=100 : Car2_Speed1=0 : Car2_Speed2=1 if AI1_IsAccel then Car2_Acceleration=Car2_Acceleration+4 if Car2_Acceleration>0 then Car2_Acceleration=Car2_Acceleration-1 if Car2_Acceleration<1 then Car2_Acceleration=0 if Car2_Acceleration>100 then Car2_Acceleration=100 if Car2_Acceleration=100 then Car2_Speed1=1 : Car2_Speed2=1 if Car2_Acceleration=0 then Car2_Velocity=0 if Car2_Velocity<100 then Car2_Speed1=0 : Car2_Speed2=0 if Car2_Velocity=100 then Car2_Velocity=0 if Car2_Direction1 then 813 if Car2_Direction2 && Car2_Speed1 && Car2_Speed2 then player1x=player1x+2 if Car2_Direction2 && !Car2_Speed1 && Car2_Speed2 then player1x=player1x+1 if !Car2_Direction2 && Car2_Speed1 && Car2_Speed2 then player1y=player1y-2 if !Car2_Direction2 && !Car2_Speed1 && Car2_Speed2 then player1y=player1y-1 goto 821 813 if !Car2_Direction2 && Car2_Speed1 && Car2_Speed2 then player1x=player1x-2 if !Car2_Direction2 && !Car2_Speed1 && Car2_Speed2 then player1x=player1x-1 if Car2_Direction2 && Car2_Speed1 && Car2_Speed2 then player1y=player1y+2 if Car2_Direction2 && !Car2_Speed1 && Car2_Speed2 then player1y=player1y+1 rem Check whether car's acceleration is being resisted or not 821 if AI1_IsAccel && Car2_Acceleration<70 then 822 else 831 822 if !Car2_Direction1 && Car2_Direction2 && Car2_ResistanceDir1 && Car2_ResistanceDir2 then player1y=player1y+1 if Car2_Direction1 && !Car2_Direction2 && Car2_ResistanceDir1 && Car2_ResistanceDir2 then player1y=player1y+1 if !Car2_Direction1 && Car2_Direction2 && !Car2_ResistanceDir1 && !Car2_ResistanceDir2 then player1y=player1y-1 if Car2_Direction1 && !Car2_Direction2 && !Car2_ResistanceDir1 && !Car2_ResistanceDir2 then player1y=player1y-1 if Car2_Direction1 && Car2_Direction2 && !Car2_ResistanceDir1 && Car2_ResistanceDir2 then player1x=player1x+1 if !Car2_Direction1 && !Car2_Direction2 && !Car2_ResistanceDir1 && Car2_ResistanceDir2 then player1x=player1x+1 if !Car2_Direction1 && !Car2_Direction2 && Car2_ResistanceDir1 && !Car2_ResistanceDir2 then player1x=player1x-1 if Car2_Direction1 && Car2_Direction2 && Car2_ResistanceDir1 && !Car2_ResistanceDir2 then player1x=player1x-1 goto 836 831 if Car2_Acceleration<=75 then Car2_ResistanceDir1=Car2_Direction1 : Car2_ResistanceDir2=Car2_Direction2 : goto 836 else 832 832 if !Car2_Direction1 && Car2_ResistanceDir1 then Car2_Acceleration=0 if Car2_Direction1 && !Car2_ResistanceDir1 then Car2_Acceleration=0 if Car2_Direction2 && !Car2_ResistanceDir2 then Car2_Acceleration=0 if !Car2_Direction2 && Car2_ResistanceDir2 then Car2_Acceleration=0 836 if player2y<98 then goto __A2_Physics goto __GAME_Main_Loop bank2 __A2_Physics rem AI2 CAR PHYSICS rem Calculate Car AI1 Acceleration and move car accordingly if AI2_Health=0 then AI2_IsAccel=0 if AI2_Acceleration<=75 then AI2_Velocity=AI2_Velocity+AI2_Acceleration else AI2_Velocity=AI2_Velocity+AI2_Acceleration/2 if !switchleftb && AI2_Acceleration=100 then AI2_Velocity=101 if AI2_Velocity>100 && AI2_Acceleration>75 then AI2_Velocity=100 : AI2_Speed1=1 : AI2_Speed2=1 if AI2_Velocity>100 && AI2_Acceleration<=75 then AI2_Velocity=100 : AI2_Speed1=0 : AI2_Speed2=1 if AI2_IsAccel then AI2_Acceleration=AI2_Acceleration+4 if AI2_Acceleration>0 then AI2_Acceleration=AI2_Acceleration-1 if AI2_Acceleration<1 then AI2_Acceleration=0 if AI2_Acceleration>100 then AI2_Acceleration=100 if AI2_Acceleration=100 then AI2_Speed1=1 : AI2_Speed2=1 if AI2_Acceleration=0 then AI2_Velocity=0 if AI2_Velocity<100 then AI2_Speed1=0 : AI2_Speed2=0 if AI2_Velocity=100 then AI2_Velocity=0 if AI2_Direction1 then 862 if AI2_Direction2 && AI2_Speed1 && AI2_Speed2 then player2x=player2x+2 if AI2_Direction2 && !AI2_Speed1 && AI2_Speed2 then player2x=player2x+1 if !AI2_Direction2 && AI2_Speed1 && AI2_Speed2 then player2y=player2y-2 if !AI2_Direction2 && !AI2_Speed1 && AI2_Speed2 then player2y=player2y-1 goto 868 862 if !AI2_Direction2 && AI2_Speed1 && AI2_Speed2 then player2x=player2x-2 if !AI2_Direction2 && !AI2_Speed1 && AI2_Speed2 then player2x=player2x-1 if AI2_Direction2 && AI2_Speed1 && AI2_Speed2 then player2y=player2y+2 if AI2_Direction2 && !AI2_Speed1 && AI2_Speed2 then player2y=player2y+1 rem Check whether car's acceleration is being resisted or not 868 if AI2_IsAccel && AI2_Acceleration<70 then 869 else 877 869 if !AI2_Direction1 && AI2_Direction2 && AI2_ResistanceDir1 && AI2_ResistanceDir2 then player2y=player2y+1 if AI2_Direction1 && !AI2_Direction2 && AI2_ResistanceDir1 && AI2_ResistanceDir2 then player2y=player2y+1 if !AI2_Direction1 && AI2_Direction2 && !AI2_ResistanceDir1 && !AI2_ResistanceDir2 then player2y=player2y-1 if AI2_Direction1 && !AI2_Direction2 && !AI2_ResistanceDir1 && !AI2_ResistanceDir2 then player2y=player2y-1 if AI2_Direction1 && AI2_Direction2 && !AI2_ResistanceDir1 && AI2_ResistanceDir2 then player2x=player2x+1 if !AI2_Direction1 && !AI2_Direction2 && !AI2_ResistanceDir1 && AI2_ResistanceDir2 then player2x=player2x+1 if !AI2_Direction1 && !AI2_Direction2 && AI2_ResistanceDir1 && !AI2_ResistanceDir2 then player2x=player2x-1 if AI2_Direction1 && AI2_Direction2 && AI2_ResistanceDir1 && !AI2_ResistanceDir2 then player2x=player2x-1 goto 882 877 if AI2_Acceleration<=75 then AI2_ResistanceDir1=AI2_Direction1 : AI2_ResistanceDir2=AI2_Direction2 : goto 882 else 878 878 if !AI2_Direction1 && AI2_ResistanceDir1 then AI2_Acceleration=0 if AI2_Direction1 && !AI2_ResistanceDir1 then AI2_Acceleration=0 if AI2_Direction2 && !AI2_ResistanceDir2 then AI2_Acceleration=0 if !AI2_Direction2 && AI2_ResistanceDir2 then AI2_Acceleration=0 882 goto __GAME_Main_Loop bank2 A bit better than it was before, and I did notice a small decrease in scanlines when I do an ALT-L in Stella. But it's still pretty bad, and ontop of that, the changes I made caused the actual control to feel different. I preferred how the car controlled before, and it seems to me nothing should be acting different. I'm probably doing something wrong, but there really is so much code I have to go through and it's just turning my brain into a watermelon.
-
Okay. xDDD!!!!! Yeah, I'm almost 154% certain that that's why the game is slowing down! LOL! The only thing is, is there a limit to how many loops for skipping some code I could do? Or maybe I could use line numbers instead.
-
Well, those sound like really good suggestions. I'll give it a shot tonight. It will take a long time though. xD The code I think is the main culprit is the physics engine, and the entire thing looks like this: __Physics_P1 rem PLAYER 1 CAR PHYSICS rem Calculate Car Acceleration and move car accordingly if P1_Health=0 then P1_Acceleration=0 if P1_Acceleration<=75 then P1_Velocity=P1_Velocity+P1_Acceleration if P1_Acceleration>75 then P1_Velocity=P1_Velocity+P1_Acceleration/2 if !switchleftb && P1_Acceleration=100 then P1_Velocity=101 if P1_Velocity>100 && P1_Acceleration>75 then P1_Velocity=100 : P1_Speed1=1 : P1_Speed2=1 if P1_Velocity>100 && P1_Acceleration<=75 then P1_Velocity=100 : P1_Speed1=0 : P1_Speed2=1 if joy0right then P1_Acceleration=P1_Acceleration+4 if joy0up then P1_Acceleration=P1_Acceleration+4 if joy0down then P1_Acceleration=P1_Acceleration+4 if joy0left then P1_Acceleration=P1_Acceleration+4 if P1_Acceleration>0 then P1_Acceleration=P1_Acceleration-1 if P1_Acceleration<1 then P1_Acceleration=0 if P1_Acceleration>100 then P1_Acceleration=100 : P1_Resistance=0 if P1_Acceleration=100 then P1_Speed1=1 : P1_Speed2=1 if P1_Acceleration=0 then P1_Velocity=0 if P1_Velocity<100 then P1_Speed1=0 : P1_Speed2=0 if P1_Velocity=100 then P1_Velocity=0 if !joy0up && !joy0down && !joy0left && !joy0right then P1_Resistance=0 if !P1_Direction1 && P1_Direction2 && P1_Speed1 && P1_Speed2 then player0x=player0x+2 if !P1_Direction1 && P1_Direction2 && !P1_Speed1 && P1_Speed2 then player0x=player0x+1 if !P1_Direction1 && !P1_Direction2 && P1_Speed1 && P1_Speed2 then player0y=player0y-2 if !P1_Direction1 && !P1_Direction2 && !P1_Speed1 && P1_Speed2 then player0y=player0y-1 if P1_Direction1 && !P1_Direction2 && P1_Speed1 && P1_Speed2 then player0x=player0x-2 if P1_Direction1 && !P1_Direction2 && !P1_Speed1 && P1_Speed2 then player0x=player0x-1 if P1_Direction1 && P1_Direction2 && P1_Speed1 && P1_Speed2 then player0y=player0y+2 if P1_Direction1 && P1_Direction2 && !P1_Speed1 && P1_Speed2 then player0y=player0y+1 rem Decrease carspeed when the opposite directional key is pressed while the car is moving if P1_Acceleration>1 && !P1_Direction1 && P1_Direction2 && joy0left then P1_Acceleration=P1_Acceleration-6 if P1_Acceleration>1 && !P1_Direction1 && !P1_Direction2 && joy0up then P1_Acceleration=P1_Acceleration-6 if P1_Acceleration>1 && P1_Direction1 && !P1_Direction2 && joy0right then P1_Acceleration=P1_Acceleration-6 if P1_Acceleration>1 && P1_Direction1 && P1_Direction2 && joy0down then P1_Acceleration=P1_Acceleration-6 rem Check whether car's acceleration is being resisted or not if P1_Acceleration<=60 && joy0right then P1_Direction1=0 : P1_Direction2=1 if P1_Acceleration<=60 && joy0down then P1_Direction1=0 : P1_Direction2=0 if P1_Acceleration<=60 && joy0left then P1_Direction1=1 : P1_Direction2=0 if P1_Acceleration<=60 && joy0up then P1_Direction1=1 : P1_Direction2=1 if P1_Acceleration>60 && P1_Direction1 && P1_Direction2 && joy0right then P1_Acceleration=0 : P1_Direction1=0 : P1_Direction2=1 : P1_Resistance=4 if P1_Acceleration>60 && !P1_Direction1 && !P1_Direction2 && joy0right then P1_Acceleration=0 : P1_Direction1=0 : P1_Direction2=1 : P1_Resistance=2 if P1_Acceleration>60 && P1_Direction1 && P1_Direction2 && joy0left then P1_Acceleration=0 : P1_Direction1=1 : P1_Direction2=0 : P1_Resistance=4 if P1_Acceleration>60 && !P1_Direction1 && !P1_Direction2 && joy0left then P1_Acceleration=0 : P1_Direction1=1 : P1_Direction2=0 : P1_Resistance=2 if P1_Acceleration>60 && P1_Direction1 && !P1_Direction2 && joy0up then P1_Acceleration=0 : P1_Direction1=1 : P1_Direction2=1 : P1_Resistance=3 if P1_Acceleration>60 && !P1_Direction1 && P1_Direction2 && joy0up then P1_Acceleration=0 : P1_Direction1=1 : P1_Direction2=1 : P1_Resistance=1 if P1_Acceleration>60 && P1_Direction1 && !P1_Direction2 && joy0down then P1_Acceleration=0 : P1_Direction1=0 : P1_Direction2=0 : P1_Resistance=3 if P1_Acceleration>60 && !P1_Direction1 && P1_Direction2 && joy0down then P1_Acceleration=0 : P1_Direction1=0 : P1_Direction2=0 : P1_Resistance=1 if P1_Resistance=1 then player0x=player0x+1 if P1_Resistance=2 then player0y=player0y-1 if P1_Resistance=3 then player0x=player0x-1 if P1_Resistance=4 then player0y=player0y+1 if player1y<98 then goto __Physics_A1 bank4 goto __GAME_Main_Loop bank2 ---------------------------------------------------------- bank 4 __Physics_A1 rem AI1 CAR PHYSICS rem Calculate Car AI1 Acceleration and move car accordingly if Car2_Health=0 then AI1_IsAccel=0 if Car2_Acceleration<=75 then Car2_Velocity=Car2_Velocity+Car2_Acceleration if Car2_Acceleration>75 then Car2_Velocity=Car2_Velocity+Car2_Acceleration/2 if !switchleftb && Car2_Acceleration=100 then Car2_Velocity=101 if Car2_Velocity>100 && Car2_Acceleration>75 then Car2_Velocity=100 : Car2_Speed1=1 : Car2_Speed2=1 if Car2_Velocity>100 && Car2_Acceleration<=75 then Car2_Velocity=100 : Car2_Speed1=0 : Car2_Speed2=1 if AI1_IsAccel then Car2_Acceleration=Car2_Acceleration+4 if Car2_Acceleration>0 then Car2_Acceleration=Car2_Acceleration-1 if Car2_Acceleration<1 then Car2_Acceleration=0 if Car2_Acceleration>100 then Car2_Acceleration=100 if Car2_Acceleration=100 then Car2_Speed1=1 : Car2_Speed2=1 if Car2_Acceleration=0 then Car2_Velocity=0 if Car2_Velocity<100 then Car2_Speed1=0 : Car2_Speed2=0 if Car2_Velocity=100 then Car2_Velocity=0 if !Car2_Direction1 && Car2_Direction2 && Car2_Speed1 && Car2_Speed2 then player1x=player1x+2 if !Car2_Direction1 && Car2_Direction2 && !Car2_Speed1 && Car2_Speed2 then player1x=player1x+1 if !Car2_Direction1 && !Car2_Direction2 && Car2_Speed1 && Car2_Speed2 then player1y=player1y-2 if !Car2_Direction1 && !Car2_Direction2 && !Car2_Speed1 && Car2_Speed2 then player1y=player1y-1 if Car2_Direction1 && !Car2_Direction2 && Car2_Speed1 && Car2_Speed2 then player1x=player1x-2 if Car2_Direction1 && !Car2_Direction2 && !Car2_Speed1 && Car2_Speed2 then player1x=player1x-1 if Car2_Direction1 && Car2_Direction2 && Car2_Speed1 && Car2_Speed2 then player1y=player1y+2 if Car2_Direction1 && Car2_Direction2 && !Car2_Speed1 && Car2_Speed2 then player1y=player1y+1 rem Check whether car's acceleration is being resisted or not if AI1_IsAccel && Car2_Acceleration<70 && !Car2_Direction1 && Car2_Direction2 && Car2_ResistanceDir1 && Car2_ResistanceDir2 then player1y=player1y+1 if AI1_IsAccel && Car2_Acceleration<70 && Car2_Direction1 && !Car2_Direction2 && Car2_ResistanceDir1 && Car2_ResistanceDir2 then player1y=player1y+1 if AI1_IsAccel && Car2_Acceleration<70 && !Car2_Direction1 && Car2_Direction2 && !Car2_ResistanceDir1 && !Car2_ResistanceDir2 then player1y=player1y-1 if AI1_IsAccel && Car2_Acceleration<70 && Car2_Direction1 && !Car2_Direction2 && !Car2_ResistanceDir1 && !Car2_ResistanceDir2 then player1y=player1y-1 if AI1_IsAccel && Car2_Acceleration<70 && Car2_Direction1 && Car2_Direction2 && !Car2_ResistanceDir1 && Car2_ResistanceDir2 then player1x=player1x+1 if AI1_IsAccel && Car2_Acceleration<70 && !Car2_Direction1 && !Car2_Direction2 && !Car2_ResistanceDir1 && Car2_ResistanceDir2 then player1x=player1x+1 if AI1_IsAccel && Car2_Acceleration<70 && !Car2_Direction1 && !Car2_Direction2 && Car2_ResistanceDir1 && !Car2_ResistanceDir2 then player1x=player1x-1 if AI1_IsAccel && Car2_Acceleration<70 && Car2_Direction1 && Car2_Direction2 && Car2_ResistanceDir1 && !Car2_ResistanceDir2 then player1x=player1x-1 if Car2_Acceleration>70 && Car2_Acceleration<=75 then Car2_ResistanceDir1=Car2_Direction1 : Car2_ResistanceDir2=Car2_Direction2 if Car2_Acceleration>75 && !Car2_Direction1 && Car2_ResistanceDir1 then Car2_Acceleration=0 if Car2_Acceleration>75 && Car2_Direction1 && !Car2_ResistanceDir1 then Car2_Acceleration=0 if Car2_Acceleration>75 && Car2_Direction2 && !Car2_ResistanceDir2 then Car2_Acceleration=0 if Car2_Acceleration>75 && !Car2_Direction2 && Car2_ResistanceDir2 then Car2_Acceleration=0 if player2y<98 then goto __A2_Physics goto __GAME_Main_Loop bank2 __A2_Physics rem AI2 CAR PHYSICS rem Calculate Car AI1 Acceleration and move car accordingly if AI2_Health=0 then AI2_IsAccel=0 if AI2_Acceleration<=75 then AI2_Velocity=AI2_Velocity+AI2_Acceleration if AI2_Acceleration>75 then AI2_Velocity=AI2_Velocity+AI2_Acceleration/2 if !switchleftb && AI2_Acceleration=100 then AI2_Velocity=101 if AI2_Velocity>100 && AI2_Acceleration>75 then AI2_Velocity=100 : AI2_Speed1=1 : AI2_Speed2=1 if AI2_Velocity>100 && AI2_Acceleration<=75 then AI2_Velocity=100 : AI2_Speed1=0 : AI2_Speed2=1 if AI2_IsAccel then AI2_Acceleration=AI2_Acceleration+4 if AI2_Acceleration>0 then AI2_Acceleration=AI2_Acceleration-1 if AI2_Acceleration<1 then AI2_Acceleration=0 if AI2_Acceleration>100 then AI2_Acceleration=100 if AI2_Acceleration=100 then AI2_Speed1=1 : AI2_Speed2=1 if AI2_Acceleration=0 then AI2_Velocity=0 if AI2_Velocity<100 then AI2_Speed1=0 : AI2_Speed2=0 if AI2_Velocity=100 then AI2_Velocity=0 if !AI2_Direction1 && AI2_Direction2 && AI2_Speed1 && AI2_Speed2 then player2x=player2x+2 if !AI2_Direction1 && AI2_Direction2 && !AI2_Speed1 && AI2_Speed2 then player2x=player2x+1 if !AI2_Direction1 && !AI2_Direction2 && AI2_Speed1 && AI2_Speed2 then player2y=player2y-2 if !AI2_Direction1 && !AI2_Direction2 && !AI2_Speed1 && AI2_Speed2 then player2y=player2y-1 if AI2_Direction1 && !AI2_Direction2 && AI2_Speed1 && AI2_Speed2 then player2x=player2x-2 if AI2_Direction1 && !AI2_Direction2 && !AI2_Speed1 && AI2_Speed2 then player2x=player2x-1 if AI2_Direction1 && AI2_Direction2 && AI2_Speed1 && AI2_Speed2 then player2y=player2y+2 if AI2_Direction1 && AI2_Direction2 && !AI2_Speed1 && AI2_Speed2 then player2y=player2y+1 rem Check whether car's acceleration is being resisted or not if AI2_IsAccel && AI2_Acceleration<70 && !AI2_Direction1 && AI2_Direction2 && AI2_ResistanceDir1 && AI2_ResistanceDir2 then player2y=player2y+1 if AI2_IsAccel && AI2_Acceleration<70 && AI2_Direction1 && !AI2_Direction2 && AI2_ResistanceDir1 && AI2_ResistanceDir2 then player2y=player2y+1 if AI2_IsAccel && AI2_Acceleration<70 && !AI2_Direction1 && AI2_Direction2 && !AI2_ResistanceDir1 && !AI2_ResistanceDir2 then player2y=player2y-1 if AI2_IsAccel && AI2_Acceleration<70 && AI2_Direction1 && !AI2_Direction2 && !AI2_ResistanceDir1 && !AI2_ResistanceDir2 then player2y=player2y-1 if AI2_IsAccel && AI2_Acceleration<70 && AI2_Direction1 && AI2_Direction2 && !AI2_ResistanceDir1 && AI2_ResistanceDir2 then player2x=player2x+1 if AI2_IsAccel && AI2_Acceleration<70 && !AI2_Direction1 && !AI2_Direction2 && !AI2_ResistanceDir1 && AI2_ResistanceDir2 then player2x=player2x+1 if AI2_IsAccel && AI2_Acceleration<70 && !AI2_Direction1 && !AI2_Direction2 && AI2_ResistanceDir1 && !AI2_ResistanceDir2 then player2x=player2x-1 if AI2_IsAccel && AI2_Acceleration<70 && AI2_Direction1 && AI2_Direction2 && AI2_ResistanceDir1 && !AI2_ResistanceDir2 then player2x=player2x-1 if AI2_Acceleration>70 && AI2_Acceleration<=75 then AI2_ResistanceDir1=AI2_Direction1 : AI2_ResistanceDir2=AI2_Direction2 if AI2_Acceleration>75 && !AI2_Direction1 && AI2_ResistanceDir1 then AI2_Acceleration=0 if AI2_Acceleration>75 && AI2_Direction1 && !AI2_ResistanceDir1 then AI2_Acceleration=0 if AI2_Acceleration>75 && AI2_Direction2 && !AI2_ResistanceDir2 then AI2_Acceleration=0 if AI2_Acceleration>75 && !AI2_Direction2 && AI2_ResistanceDir2 then AI2_Acceleration=0 goto __GAME_Main_Loop bank2
-
Alright, so I'm still kind of a beginner programmer using Batari Basic, but I've also been working on a pretty ambitious project called Auto Mayhem. Everything in the game works the way I want it to, but now I'm at the point where I wish I knew how to optimize my code, because it's running over the 262 scanline limit. So there are a few questions I have in regards to this: Are there any detailed tutorials on code optimization for people who know the language, but are still relatively new to it? When the code is processed by the Atari 2600 or an emulator, and an if-then statement proves to be false, does that if-then statement still use up cycles? (I'm guessing it does, seeing that it still has to determine whether the statement is true or false regardless) I have a crap-ton of if-then statements in my game that are half-duplicate, e.g.: if P1_Acceleration&--#62;60 && P1_Direction1 && P1_Direction2 && joy0right then P1_Acceleration=0 : P1_Direction1=0 : P1_Direction2=1 : P1_Resistance=4 if P1_Acceleration&--#62;60 && P1_Direction1 && P1_Direction2 && joy0left then P1_Acceleration=0 : P1_Direction1=1 : P1_Direction2=0 : P1_Resistance=4 Even though the if statements are checking for very similar conditions, they're also checking another slightly different condition as well. It almost seems like I should be able to simplify these two statements into one. Is there any way to do this to save on cycles? When action is at its max in my game, it runs up to about 280 scanlines. That's 18 scanlines over where I should be. Codewise, how "too much" exactly is that? In other words, do I have to remove/optimize the code by just a little to get down to 262, or do I have to remove/optimize almost the entire game? Any help is greatly appreciated. Thank you. ^^
-
Have you ever paid too much just because you really want it?
Lodmot replied to Cassidy Nolen's topic in Atari 2600
I paid 90 bucks for a copy of Swordquest Waterworld. It was just the cart, but it's in mint condition. I still haven't taken it out of the plastic bag that it was shipped in, because I want to keep it nice. ^^ Also, when I saw the video of Boulder Dash 2600, it blew my mind, and just out of the blue, I bought it at 3 in the morning. xDDD -
The games I make for the 2600 are unbeatable. .......... Aren't I mean? ;D
-
Thanks for the tip. Radio Shack seems to be carrying less and less necessities but I'll check. Not a problem. ^^ Also, I'm not sure if you're new at fixing Atari consoles or not, but in case you're not: On the older 2600 models, the RF cable looks like it's hardwired to the console, but when you take the system apart, you'll notice that the RF cable actually plugs in on the inside as well, which means you don't have to cut the wire and solder anything, which is awesome.
-
Dude, the RF cables are actually regular single RCA cables. Go to Radio Shack and find one for like 6 bucks.
-
Just literally got this in the mail today! Bought it on eBay for 34 dollars, and fixed it to nearly perfect working condition. Hell yeah. ;D The guy said it was missing an RF cable, so I replaced it. I also had to replace the PIA and MPU chips. Other than that, the system is working great now. Awesome reception, and I can't believe how fat this thing is compared to a regular sixer! DAYUMN!!!!!!!! I replaced two of the three chips in the main board, but before I did, I got the latest date code from them, which was 7734. The only problem it still has is that the fire buttons will be triggered by themselves after a period of use. SERIAL NO: 67410F TV Type: NTSC (However I discovered that adjusting the vertical hold on an older TV allows PAL games to display correctly as well) Date Codes: 7734, 7709, 7732 (These are the original ones that came with the system) Channel A/B Select: No switch, and no hole, tramsmits to channel 3 Working: Wasn't before, but now it is.
-
I used double-sided scotch tape on my berzerk cart. So far, it's held up okay, but it hasn't been 10 years. XD It's also nice in that it binds the label to the cart instantly.
