All aboard! The Coding Train is on its way with creative coding video tutorials on subjects ranging from the basics of programming languages like JavaScript to algorithmic art, machine learning, simulation, generative poetry, and more. Choo choo!
I want to draw a pair of eyes and I want the pupils to move with my mouse but I obviously don't want them to leave their respective eyeballs. What should I do?
I think an iterative approach might be quicker to explain and understand than a recursive one, like this: expand(start, rules): { Ret is an empty array. While start isn’t empty: { Remove the first element of start; call it firstTerm. If firstTerm isn’t in rules: { Append firstTerm to ret. } Otherwise: { Pick a random element from rules[firstTerm]; call it expanded. Start becomes expanded + start (combine two lists of elements). } } Return ret. }
I remember making similar games but on the TRS-80 model 1. When I upgraded to the model 3, I started advertising the game in software publications similar to yellow pages. I didn't sell a single copy. Haha.
I loved these Apple II coding challenges! I really hope you revisit this series at some point. I have programmed a lot on a somewhat modernised version of BASIC thanks to SmileBASIC for the Nintendo Switch and Nintendo 3DS, so I have a fondness for this old-fashioned algorithmic programming. Maybe at some point you could take a look at this great piece of software by SmileBoom! (I reccomend the switch version so you can use a USB keyboard) Aside from the text-based and graphics mode stuff, it has capacity to load and save backgrounds, display tilemaps, move sprites, and play sounds and music, with a built-in library of example graphics, music and sound. This makes it into a very simple game engine of sorts, but it has a real vintage feel since you do all by code, like a commodore and an NES put together. You can even use the hardware's unique features, like the 3DS dual-screens and touch screen, and I think the Switch version is compatible with the LABO cardboard controllers. It can be compared to Processing in how it makes programming fun, visual and creative, but running on a BASIC-style paradigm. You can really tell it's a labour of love. A shame that you can't compile the programs for PC. At one point I even programmed a game engine to wrap the per-sprite code functionality, being able to define and instantiate sprite classes, and run framerate independent code calculating Delta Time, in addition to some utility functions like linear interpolation. I called it the Reptile Engine for some reason. I never used it to make any games, because I couldn't deal with the mess of having so much code on a single program, and I hadn't figured out the self-modifying code functionality or any other way to separate the engine code from the game script. Still, a proud achievement, coded by touchscreen and stylus on a 3DS with no real OOP functionality.
I don't program in Javascript. I'm trying to relearn object Pascal and I thought your starfield simulation would be a good starting off point. I've got as far as creating a star type, creating an array of stars, giving them starting positions, and displaying them on the screen. Now I'm trying to animate them but Pascal doesn't have a map function. I tried to find out using Google but so far I've only found a map function in Javascript that works on arrays. What exactly is this line of code doing : sx = map(x / z, 0, 1, 0, width) ? TIA.
It’s not the JS map function it’s a special p5 function that maps a number from one range to another you can reimplement it in pascal! Search map function and p5.js for more!
@@TheCodingTrain Thanks again. One quick Google search and I found the source code for the Map function. It was only one line long and very easy to create it in Pascal.
I've been coding since forever, I'm not even sure why I started watching this, but I'm so happy I did! What a great video, you're an engaging and entertaining teacher, and I think (it's hard to say) you present it in a way that's accessible for people of all levels. Awesome work. 💗
An absolute triumph! 🌟🎥 This video is a triumph of content creation, seamlessly blending knowledge and entertainment. The presentation is flawless, and the visuals are nothing short of spectacular. I was entranced from the first moment and left with a deep appreciation for the subject matter. It's evident that the creators poured their creativity and expertise into this project, and the result is nothing short of exceptional. I'll be singing the praises of this video for a long time. Bravo! 👏🚀2.8k
13 дней назад
It seems like your quadtree example doesn't have any improvement over non quadtree approach.