Share your repls and programming experiences

← Back to all posts
Snake in BASIC
h
AmazingMech2418 (900)

Here is a game of Snake in BASIC! This is my first BASIC program (well, outside of my calculator at least with TI-BASIC and excluding Visual Basic (VB6 was my first programming language)). For maximum quality, I'd recommend positioning everything in the repl embedding so all you see is the BASIC graphics section. Unfortunately, BASIC does not yet support text with size relative to the size of the BASIC graphics section. @amasad , maybe something you could add? Also, maybe add a mouse position reading system for when it is not clicked as well? I think it would be great if I could change the color of the play button on hover. Also, currently, text displayed appears to block the click events for some reason, so try clicking just outside of the text in the play button to start. I hope you enjoy!

Commentshotnewtop
Roar123 (431)

This is really smooth! Because the text is kind of buggy, why don't you have a click anywhere to start instead.

AmazingMech2418 (900)

@Roar123 Thank you! I honestly don't know though. I could do that, but I kind of wanted a play button to start.

Roar123 (431)

@AmazingMech2418 Sure but you've pointed out the clicking on the text doesn't work and it took me a minute of clicking to finally start the game. So if you could could make it less buggy that would be great!

AmazingMech2418 (900)

@Roar123 Yeah. Unfortunately, it is a Repl.it bug though, so I guess I could do a key to start or click anywhere to start, but that's still not exactly what I want for this repl. However, I could do something like that in the Pong repl I'm creating now.

Roar123 (431)

@AmazingMech2418 Ok I get it, but you should probably allow people the option to press enter or another key to start

BlueComet (116)

This is really nice super smooth.Great job!

BlueComet (116)

@AmazingMech2418 do you know why you can't click play and have to click next to it

AmazingMech2418 (900)

@iterate I think it has to do with the layering in the rendering of the BASIC graphics. I think that since the text is on top of the grid system, if the click event is based on the grid system instead of the window, it will not register. However, I'm not completely sure and hopefully, @amasad can fix it soon.

Rileymabb (6)

You use Ti-Basic too!? I used to use TI-baisc until I learned a more advanced language.

AmazingMech2418 (900)

@Rileymabb Well, I just used TI-BASIC to create some basic programs to automatically plug in values into equations on my calculator to get my homework done faster. LOL! I also tried to do a pong game on it, but never had the time.

Rileymabb (6)

@AmazingMech2418 Yeah, learning BASIC makes it easier to understand programming concepts

AmazingMech2418 (900)

@nN34398Ff That is weird. It might be that it spawned the "apple" off the grid, but it shouldn't do that...

Wilke000 (485)

Nevermind I got it WASD

ImmortalFlash (3)

My first tiem trying it out, I thing its great!