![]() |
Using Lua to create games in PR3R - Printable Version +- Jiggmin's Village (https://jiggmin2.com/forums) +-- Forum: Arcade (https://jiggmin2.com/forums/forumdisplay.php?fid=3) +--- Forum: Jiggmin Games (https://jiggmin2.com/forums/forumdisplay.php?fid=15) +---- Forum: Platform Racing 3 (https://jiggmin2.com/forums/forumdisplay.php?fid=9) +---- Thread: Using Lua to create games in PR3R (/showthread.php?tid=2990) |
Using Lua to create games in PR3R - ThePizzaEater1000 - 22nd September 2020 Recently (actually a bit over a month ago), there has been a significant breakthrough in PR3 lua. The user gasterskyRAW has figured out an easy to implement optimization of block.getblock.teleportto. This optimization is highly effective, increasing the speed by about four to five times. This breakthrough has allowed the creation of a gaming console (also by gasterskyRAW), and perhaps the most advanced use of Lua in Platform Racing 3 yet. The console provides only a few simple commands and variables to use. Code: draw_pixel(x, y, color) -- draw a pixel of defined color at (x,y) The console also originally only gave access to 16 colors. Code: 0 - #000000 (black) Making a game isn't particularly difficult as long as you know what you're doing and refer to the lua documents enough. This led to me making several, including Bucket ![]() Super Ball ![]() Asteroid game ![]() Snake ![]() Revamped bucket ![]() Tetris was also made, but not by me, and it's breaks for no reason. Several colors were later added to fill gaps in the color specturm. Hopefully, this gets remade in ROP, which should run significantly faster than PR3 does, possibly allowing us to do far more than just these simple games. For now though, a couple more will be made in PR3 in the last few months before the game dies for good. Currently, I'm working on Super Ball 2, and eventually I'll also fix Tetris, and maybe make a quick operating system. There's a bit of hope that a few features (sound pitch and faster getblock) could help us make a few more games. Main benefits of ROP would probably be Larger display 60 FPS gameplay Probably more colors because why not eventually I'll simulate infinite rollers with one of these. Actually, I might do it now. RE: Using Lua to create games in PR3R - Camer the Dragon - 23rd September 2020 it's very cool I find the 3d ship demo very good also cos it's literally 3d wireframe made in pr3 RE: Using Lua to create games in PR3R - ThePizzaEater1000 - 23rd September 2020 (23rd September 2020, 4:22 PM)Camer the Dragon Wrote: it's very coolI'm considering writing up a framework for display of wireframe 3D objects. Seems annoying to do tho. RE: Using Lua to create games in PR3R - Mia - 23rd September 2020 I didn't realize PR3R could be an Atari 2600 emulator. RE: Using Lua to create games in PR3R - Northadox - 24th September 2020 Incredibly amazing and fabulous, but ultimately pointless. Which is exactly the sort of thing I love RE: Using Lua to create games in PR3R - ThePizzaEater1000 - 26th September 2020 (25th September 2020, 11:15 PM)Delphinoid Wrote: If you can draw points, you can draw lines, and rendering 3D wireframes is one of the most basic possible applications of that. If you're not happy with orthographic projection, just multiply all your vertices through by a perspective matrix. Things get slightly trickier if you want to rasterize (textured) triangles, but it's still pretty trivial. There is built in support for drawing lines, so that shouldn't be hard. Thing is, I want to add easy to use support for camera rotation and spin, which is the annoying bit. RE: Using Lua to create games in PR3R - ThePizzaEater1000 - 10th October 2020 Started working on some basic 3d. Right now, it's looking to support camera position and rotation on one axis; the main reason for only one axis of rotation is because that way I can use complex numbers to easily handle rotation and it wont be as difficult as matrices. Whenever ROP (successor to PR3R) comes around is probably when I'm gonna make full 3d, since more processing power will be available and it'll be usable for far longer. Code is below Code: -- initialize camera vars & constants this hasn't been tested in any capacity i have no clue if it works lol RE: Using Lua to create games in PR3R - ThePizzaEater1000 - 11th October 2020 (10th October 2020, 9:24 PM)Delphinoid Wrote: The way you're using complex numbers right now seems totally unnecessary. The idea is fine, but you don't actually need to use a complex number library, you can stick to regular floats with just sine and cosine if you're concerned with efficiency. I can also help if you'd like more information on how to adapt matrices for rotation, I think they're pretty straightforward, and more importantly there's a lot of really nifty stuff to learn.I was actually already planning to use quaternions to allow programmers to rotate a given object on a given axis, which is enough for what we're probably able to do with this with the limited computation power. It's also pretty convenient to use quaternions, since I already have code for them in the same function block that has the code for complex numbers. RE: Using Lua to create games in PR3R - ThePizzaEater1000 - 13th October 2020 we did the is!!! https://youtu.be/HR4kAWm6gNo RE: Using Lua to create games in PR3R - ThePizzaEater1000 - 28th October 2020 ![]() Getting ready for 9-bit color display RE: Using Lua to create games in PR3R - ThePizzaEater1000 - 28th October 2020 512 colors works. I have set up an emulator that maps old colors to new colors, and it works great! A little bit laggier but that is to be expected with such a large palette ![]() RE: Using Lua to create games in PR3R - ThePizzaEater1000 - 30th October 2020 and we have transparency ![]() RE: Using Lua to create games in PR3R - Camer the Dragon - 30th October 2020 Can't wait for the general artificial intelligence made with PR3R lua |