Using missiles in bAtari basic | Making an Atari 2600 game pt. 3 | Falling Alien link in description

  Рет қаралды 771

8bitsinthebasement

8bitsinthebasement

Күн бұрын

Пікірлер: 43
@Keeping_IT_Simple
@Keeping_IT_Simple Жыл бұрын
Not only a good introduction to Atsri Basic but also a great guide on learning to program in general .... Well done !
@8bitsinthebasement
@8bitsinthebasement Жыл бұрын
It's great that you think so, I'm having a lot of fun learning and it's all new to me as I've never dabbled in programming of any kind before. Now I wish I had started years and years ago ;)
@jordanschmitt8506
@jordanschmitt8506 Жыл бұрын
Can't wait to see the game on Nintendo Switch and PS5
@8bitsinthebasement
@8bitsinthebasement Жыл бұрын
Give me another couple of days, I working on the binarys for them both as we speak ;)
@Tekenduis98
@Tekenduis98 Жыл бұрын
I love the fact that you thought about making a game for the 2600. I think it would be cool to create a new game as there is so many people collecting old VCS systems that im sure a new cartridge would be very cool. If youre open to it, I could perhaps assist with sound/midi. I have a bit of experience with modern programming using python etc but have never looked into anything from the 8 or 16 bit era lol.
@8bitsinthebasement
@8bitsinthebasement Жыл бұрын
It's something I've wanted to do for a really long time but I never in my wildest dreams thought that I could until I heard of the existence of bAtari basic. I'm afraid that any game I write will only see the inside of a cartridge if I burn it onto a ROM myself. The quality of new games for the system really is very high (take a look on Atari Age) and I don't think that anything I'll ever make could hold a candle to any of those. But I'm having a whole lot of fun trying ;)
@andropovbr
@andropovbr Жыл бұрын
I can't thank you enough! I wasted about one day reading other people's code to try to understand how to properly fire a missile up the screen, but your video teach me in 10 minutes how to do it.
@8bitsinthebasement
@8bitsinthebasement Жыл бұрын
It's great that the video helped you out, I guess that I must be doing something right ;) I've got loads more videos about bAtari basic on the way. Like yourself I'm just learning to use it and making a video with each step I make, in fact you should check out the comment from "viditibi" below. He modified my falling alien code (and included a link to it) to make a missile that fires up the screen but is not locked into the ships X position. Take care and thanks for watching.
@JosipRetroBits
@JosipRetroBits Жыл бұрын
Great video Peter :) Your game progresses really nicely and now with all the moving objects it's beginning to feel like a real game, it also gets more complex and increases a chance of a bug that you have experienced here; ...so welcome to the party :) Cheers!
@8bitsinthebasement
@8bitsinthebasement Жыл бұрын
Many thanks Josip, the more I do the more I like doing it, I wish I had given this a try years and years ago ;)
@JosipRetroBits
@JosipRetroBits Жыл бұрын
​@@8bitsinthebasement It's never too late for anything :) Keep up the great work!
@CyberhugTechnologies
@CyberhugTechnologies Жыл бұрын
Great episode Peter, again took me back in time. I am not sure what the bAtari basic can do or how to put some random generator to work for you but back in the day and at least for several systems, the same RND(x) -kind of function- was used, of course with the appropriate limitation (e.g. screen location coordinates, numeric values or other stuff), thank you so much again for sharing knowledge and experience mate!
@8bitsinthebasement
@8bitsinthebasement Жыл бұрын
Glad that I managed to take you back in time Cyberhug ;) You should give bAtari basic a try sometime. It's different than the Atari basic found on the 400 and 800 computers. It was developed to allow easy compiling to Machine Language to make games for the 2600. You can even burn the resulting bin file to a rom and use it on a real console. Thanks for watching buddy ;)
@TRONMAGNUM2099
@TRONMAGNUM2099 Жыл бұрын
Nice work. Kinda reminds me of astro blast. The only difference was the asteroids you skipped deducted points. Not sure if that is a possibility? That game got extremely hectic as time went on. Nice job on your first game. You are well on the way to becoming a master programmer.
@8bitsinthebasement
@8bitsinthebasement Жыл бұрын
Thanks Tron, putting "if player1y=89 then score=score-1" into the code would deduct a point for every miss but the way I implemented my lives counter into the score would play havoc with it. All the same bAtari has all kinds of ways and means to add life counters and energy bars without touching the score board. But like I said I like to try finding my way of doing things before I go reading up on the official way. One really great thing about this bAtari basic is that every time you compile your code into a BIN file it also spits out an ASM file containing the assembler code for what you've just written, opening the door a crack wider to the world of real coding ;)
@RudysRetroIntel
@RudysRetroIntel Жыл бұрын
Amazing and awesome!! Keep up the great work! Thanks for sharing
@8bitsinthebasement
@8bitsinthebasement Жыл бұрын
Thanks for watching Rudy, playing around with basic is a lot more fun than I ever thought it could be ;)
@RetroRepairGuy
@RetroRepairGuy Жыл бұрын
Needless to say I'll be watching this twice! This is seriously a great little series and I think you should somehow package it and sell it when you're done. All your hard work, I would certainly purchase one! Sorry for watching and commenting a little late; I was really waiting for this video but unfortunately you released it on the day of my wedding and I don't think Mrs. RRG would have been too happy with me watching on my honeymoon night! 😉🤪 Cheers! Can't wait for the next one!
@8bitsinthebasement
@8bitsinthebasement Жыл бұрын
Congratulations on the wedding and I wish you both all the very best. I don't hold it against you for not watching straight away (I don't want to be responsible for causing a divorce on the wedding night). But I am happy that you find it useful, pushes me on to keep it up, thanks ;)
@RetroRepairGuy
@RetroRepairGuy Жыл бұрын
​@@8bitsinthebasement My friend, if I didn't like it, I would just be silent and not watch. I watch because I genuinely like your content. Thank you for the kind wishes and please do keep it up!
@tenminutetokyo2643
@tenminutetokyo2643 Жыл бұрын
DOOD!
@viditibi
@viditibi Жыл бұрын
Great video and very clever tricks
@8bitsinthebasement
@8bitsinthebasement Жыл бұрын
Thank you very much ;)
@thomo5
@thomo5 Жыл бұрын
Très bonnes vidéo! je ne connais pas le batari BASIC , mais c'est franchement intéressant, merci pour cette découverte.
@8bitsinthebasement
@8bitsinthebasement Жыл бұрын
bAtari est un langage que j'ai découvert à la fin de l'année dernière. Ce n'est pas trop difficile à apprendre et tu peux obtenir d'excellents résultats rapidement en l'utilisant. Tu devrais l'essayer ;)
@thomo5
@thomo5 Жыл бұрын
@@8bitsinthebasement Merci
@talideon
@talideon Жыл бұрын
If bAtari BASIC doesn't have a random function, the you should look up linear feedback shift registers. They're not as complex as the name implies, and simple ones can be implemented in a really small amount of code: you just need somewhere to store the current value, and a very simple one can be implemented with the ROL and EOR instructions. More practical ones are going to be more complicated to give better pseudo-randomness, but even a very simple one can be good enough.
@8bitsinthebasement
@8bitsinthebasement Жыл бұрын
bAtari has random functions built into it and from what I've read they work well and can be easily adapted to suit whatever level of randomness your game requires. I just like to play around a little and see if I can find "my way" to do stuff some times. It helps me learn ;) I will take a look at what you've suggested about the ROL and EOR instructions too though. As far as I know it's possible to integrate ML into bAtari and you never know when stuff like that would come in handy.
@renatoaraujo4601
@renatoaraujo4601 9 ай бұрын
THANK YOU!
@8bitsinthebasement
@8bitsinthebasement 9 ай бұрын
You're welcome, good luck with your project
@viditibi
@viditibi Жыл бұрын
The problem of coming back from death is due to the way you handle death case, you check if lives counter is zero or below and if so you hide sprites setting color to black, but even if you don't see the sprites because of color black they keep playing in the game, the alien sprite keeps moving and also the player sprite if you use the joystick, as main loop keeps executing there's a chance for a hit between sprites in each loop (black sprites can collide), if such a collision happen then life counter is decreased by 1, so now it is negative, and it would be more negative with each collision. The if condition checking for 0 lives is supposed to be true if lives counter is negative or 0 (l < 1) but batari if makes an unsigned comparation, so -2 < 1 is really comparing 254 < 1 and 254 is clearly greater than 1 so sprites colors are not changed to black and since at the beginning of main loop sprites colors and positions are set to default values, sprites come out to live apearing with default colors and since now death cheking never set colors to black, they keep their default colors. The reason of score having a 9 for life counter is score expects BCD numbers and 254 is not a BCD number (max BCD number in a byte is 153) so behaviour is unpredictable getting trash. A solution to the problem is setting the player position in a place it never can hit the alien as soon as lives counter is 0, for example setting player y position to 230. Once done there will be no collisions and thus live counter will be 0 forever. A better solution is to enter in a forever loop at game over, avoiding loosing time in calculating positions and collisions and whatever since game is over, nothing is playing there.
@viditibi
@viditibi Жыл бұрын
I think I have improved it a bit, making it more clear, you can get it here drive.google.com/file/d/1LyvSY-FfpvNj15nwrejICQ8BPp6MO8aA/view?usp=sharing
@8bitsinthebasement
@8bitsinthebasement Жыл бұрын
Thanks for all your hard work viditibi, thanks to you I now know how to fire missiles that go straight and don't follow the player's x axis ;)
@8bitsinthebasement
@8bitsinthebasement Жыл бұрын
You're right, to end the game I just changed the player sprites to the background colour, the game plays on anyway and on the off chance that player 1 hits player 0 then the lives counter goes from 0 to what should be -1 but is in fact 255 giving 9 more lives to the player. Many, many thanks for your detailed comment and for your solution, much appreciated ;)
@viditibi
@viditibi Жыл бұрын
@@8bitsinthebasement thanks to you for your great videos and amazing work
@Lampsha
@Lampsha 6 ай бұрын
Hello, great work on the videos. I have tinkered around and looked around. I can't seem to get the missile to not always be equal to the player's X coordinate after being fired. Did you ever find a decent solution to this?
@Lampsha
@Lampsha 6 ай бұрын
I actually was able to figure it out with these simple tweaks. I don't know if this is the best way to do this, but this is what I did. I think it had something to do with the code thinking I was rapid firing, so it continually was setting the start location of the missile at where the last missile shot was on the X axis. That's my guess, could be wrong...... x=80 d=1 main COLUBK=$00 COLUP0=$21 player0: %0001000 %0010100 %1100011 %1100011 %0010100 %0010100 %0001000 end player0x=x player0y=89 if joy0right then x=x+1 if joy0left then x=x-1 if joy0fire then d=2 if d=1 then missile0x=player0x+5:missile0y=0:c=0 ;set missile x to player x when missile is not fired if d=2 then missile0x=missile0x:missile0y=83-c ; set missile x to missile x vs player x upon firing c=c+1 if c>90 then c=0:d=1 if missile0y>90 then missile0x=player0x+5 ;reset missile X to player when missile is off screen drawscreen goto main
@8bitsinthebasement
@8bitsinthebasement 6 ай бұрын
Good job and don't fret about the best way to do things. I was just learning this stuff as I made the videos (I'm sure that that shows) and there were some things that took me a lot of time to figure out, like the missile problem you just solved. Good job ;) To be honest, I've found that if a solution works well, then it's good enough. Sure you could sweat about optimisation. But at the end of the day, if your game doesn't slow down, fits in the intended cartridge size and doesn't crash then you're golden. I'm glad that you're enjoying the series and thanks for commenting.
@Lampsha
@Lampsha 6 ай бұрын
@@8bitsinthebasement Definitely enjoying it. Hope to see more!
@captaincomedian6320
@captaincomedian6320 Жыл бұрын
Here's what I typed out, per your screen: main COLUBK=00 COLUP0=$21 missile0height=5 missile0x=50 missile0y=23 drawscreen goto main Pasted that into Visual batari BASIC (because the simpler Atari IDE won't open my latest downloaded and installed copy of Stella), compiled it, and... error in line 0. Learning batari Basic is hardly the fun (and consistent!) hobby people claim it to be.
@8bitsinthebasement
@8bitsinthebasement Жыл бұрын
You need to indent the last line (goto main), then it will work. bAtari can be a lot of fun but as with any language it's easy to introduce errors into the source code and they really can be a pain to find sometimes. Go on, give it another chance ;)
@captaincomedian6320
@captaincomedian6320 Жыл бұрын
​@@8bitsinthebasement Thank you so much! There was that, and it also seems to be that Visual batari BASIC does not always parse code revisions properly. Closing the file's editing tab and opening it again from the Project Explorer seems to fix this, but what an annoyance! BTW Which editor are you using in these videos?
@8bitsinthebasement
@8bitsinthebasement Жыл бұрын
@@captaincomedian6320 Happy you got to the bottom of it. When I started playing around with bAtari I had no real experience of programming at all so I decided to keep it all as simple as I possibly could. For that reason I don't use any form of IDE for development in bAtari (well, not yet anyway). What you see in the videos is the code as I entered it in "xed" (a simple text editor that comes with Linux mint, much like notepad in windows). To compile, I pass the saved .bas file through the compiler using a command prompt and test the generated bin file with Stella. I found that it works well in that I can keep everything, all my code, compiler binary and Stella in the same folder. But keep an eye out for unindented lines lines of code, I spent a good half an hour one evening trying to figure out why a previously good piece of code would no longer compile for me, the joys of programming I suppose ;)
Ben Heck’s Super Soldered Atari 2600
25:48
element14 presents
Рет қаралды 220 М.
REAL or FAKE? #beatbox #tiktok
01:03
BeatboxJCOP
Рет қаралды 18 МЛН
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН
Try this prank with your friends 😂 @karina-kola
00:18
Andrey Grechka
Рет қаралды 9 МЛН
HashMaps & Dictionaries, Explained Simply
22:44
Nic Barker
Рет қаралды 16 М.
An Engineering Fairy Tale: Cascade Failure at the Super Kamiokande
22:21
Alexander the ok
Рет қаралды 721 М.
Where Does Bad Code Come From?
42:21
Molly Rocket
Рет қаралды 213 М.
From $2 Billion to Nothing - The Rise and Fall of Atari
20:43
ColdFusion
Рет қаралды 1,7 МЛН
AI Is Making You An Illiterate Programmer
27:22
ThePrimeTime
Рет қаралды 276 М.
Nintendo Training 1991
8:31
Randy Cornetta
Рет қаралды 3,5 МЛН
Atari 5200: Making a Better Controller
17:29
element14 presents
Рет қаралды 60 М.
REAL or FAKE? #beatbox #tiktok
01:03
BeatboxJCOP
Рет қаралды 18 МЛН