Repl.it GFX: Native graphics development in the browser
repl.it
repl.it
This is just coming out and lots of users are building impressive games; here is quick small sample of things I found interesting:
- Super Mario: https://repl.it/@JONASRAINS/SMOB3-Python
- Pacman: https://repl.it/@argthe1st/Pacman
- Flappy Bird (hold space to fly): https://repl.it/@rennecastro/FlappyBird
- Dungeon game: https://repl.it/@AbrahamTinajero/VOLTHEGAME-V-061
- LOVE2D Ant: https://repl.it/@Essentuan/AntLove
- Evolution simulator: https://repl.it/@dumfing/OutpaceEvolution
- Doom style 3D maze: https://repl.it/@KatyaDelaney/GameJam-3DMAZE
I'm personally bullish on Pyxel -- the pico-8-like Python environment. Here is one of the example games running: https://repl.it/@amasad/jumper (make sure to check the sweet asset editor; instructions in the comment).
Also, I forgot to mention in the post but this works great with friends on Multiplayer -- you'll be able to interact with the same machine and output. Earlier this morning I watched YouTube with a bunch of random Twitter users: https://twitter.com/amasad/status/1108804242393821184 ^^
Client: NoVNC
Cool demo!
If you're talking about embedding the whole website then that's not doable. It's a security concern: Clickjacking etc.
Could you not provide an alternate DISPLAY environment variable pointing to a little proxy X11
Either way it's a neat hack. Is the source for the redirector available? It would undoubtedly have wider applications.
I have been following Repl.it since it's first release. We were quite amazed when repl.it was released. We, a bunch of students, were building a project very similar to what repl.it was in it's initial days, during the same time period. we never managed to get our project to an usable stage, and eventually everyone abandoned it.
I got back to working on repl.it in 2016 and my co-founders joined me.
I may have biased it, but she found the experience more engaging than MIT Scratch (which is also very good).
When kids and newbies engage with a product so easily (think git before github), you suddenly vastly increase the userbase.
However, when we talk to some of the kids coming to Repl.it from Scratch they often say something along the lines of Scratch is an "adult's idea of what kids might like". I think some kids want to feel like hackers and like they're doing "the real thing."
To that end we're working on a framework that has similar semantics to Scratch but is actually Python: https://github.com/replit/play
BTW: a 5 year old learning Clojure is fascinating. I hope you write about that sometime.
I teach a low-impact, almost impossible to fail programming elective to HS students. We start with a fork of Scratch, and we eventually move to Python. The above is generally the response of my students as well. Scratch is a nice, gentle introduction, but then it becomes more tedious clicking through categories, dragging-and-dropping, and maintaining an organized environment with larger assignments. I'm inclined to agree. Also transferring concepts from Scratch to a terminal language doesn't click for most students. I'm still working on bettering my lesson plans in that aspect.
I do want to counter with something positive about these visual implementations though. I think boot strapping the course would be 10 times harder with just a terminal language.
It's uses similar language and a Scratch-like execution model, so you can do things like this:
face = play.new_text('^.^', font_size=100)
@face.when_clicked
async def do():
face.words = '*o*'
await play.timer(seconds=1)
face.words = '^.^'Can you share the repl or add some more detail please on how was it better than traditional methods
Let's be clear that for a 5 year old, being able to substitute numbers in (+ 2 3) and seeing the results is displayed on the screen is pretty cool. And for my 3-year-old, just typing his name (after I tell him which keys to press) is magical.
Firefox 65 on Fedora 29.
Polygott
chromium-browser --no-sandbox https://repl.it/blog/gfx
XOpenDisplay((null))
Starting X
xset: unable to open display ":0"
nohup: redirecting stderr to stdout
[ I snipped out some non-error lines ]
XOpenDisplay((null))
[13:59:0322/035214.877492:ERROR:bus.cc(396)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
xcb_connection_has_error() returned true
[13:13:0322/035214.990820:ERROR:browser_dm_token_storage_linux.cc(101)] Error: /etc/machine-id contains 0 characters(32 were expected).
XOpenDisplay((null))
XOpenDisplay((null))
[67:67:0322/035215.770758:ERROR:sandbox_linux.cc(364)] InitializeSandbox() called with multiple threads in process gpu-process.
[13:254:0322/035216.684721:ERROR:bus.cc(396)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
Similar failure to run for all of them actually: Python3 with Pygame
nohup: redirecting stderr to stdout
xset: unable to open display ":0"
^CTraceback (most recent call last):
File "main.py", line 400, in <module>
main_menu(win)
File "main.py", line 387, in main_menu
draw_text_middle(win, 'Press Any Key To Play', 60, (255,255,255))
File "main.py", line 190, in draw_text_middle
label = font.render(text, 1, color)
KeyboardInterrupt
XIO: fatal IO error 0 (Success) onX server ":0"
after 135 requests (135 knownprocessed) with 1 events remaining.
exit status 1We'll add it as a top-level language soon.
In general: Repl.it infra is a multitenant container system and you might get unlucky sometimes and get a VM that's super crowded (reloading might work).
Btw, if you login we also give you more compute resources and things will run faster.
For the curious here is the cpu load avg thanks to the hackernews hug of death: https://imgur.com/a/QviYhG9
(Yellow line is a 100% saturation -- eek!)
More generally though we have millions of users that don't have the luxury of running a fancy local developer environment. Either they're on chromebooks or tablets or they don't have a computer altogether.
Blew my mind.