So I am posting this to basically share a new exciting discovery I made about physics engine development.
So I have made several attempts to making a working physics engine but have had some difficulty achieving this.
I have managed to create several games that utilizes somewhat working but also broken physics.
My two games that have semi-working physics.
However, I have found a new course that is helping me understand video game physics even more.
Excellent course on how to make a 2D game physics.
2D Video Game Physics Course is located here
Thanks to the video game physics course I now know my common problem found in these two physics engines. Both games lack the projection method of resolving collisions. I only have completed about 55% of the course so far, but
I just thought I might share that I struggled making a physics engine for pico-8 games and finally found a course
that is affordable and is actually guiding me to making a better physics engine for pico-8.
I plan on recreating these two games with a new and better physics engine. Since the course teaches how to program
physics simulation of rotations I might even make the spaceships and boxes rotate which I thought I would never have
achieved until the recent discovery of this game physics engine course.
The Pikuma website also has a 3D Soft Engine course as well in which I have purchased to learn how to make a 3D Game in pico-8. However, I have not finished the physics engine course yet so I have no input on if it is good or not.
How to play:
Press Up or X to shoot.
Press Down or Z to reload.
Push the illegal space aliens to the top of the screen.
If an illegal space alien crosses the bottom of the screen it has successfully crossed the border and damage is taken on the currently selected border patrol a.k.a Border Patrol Spaceship.
The bigger the ship the more mass it has. Thus, a ship that has greater mass requires a greater amount of bullets to push it back.
Switching from Another programming to Lua
Objective
If you are wanting to program in Pico-8 but are familiar in another programming language except for LUA. This reference will help you get started.
Further Updates
Suggestions
Direct Comparison of Programming Languages.
Class Declaration
Notes:
Lua Code
--Lua
function create_foo(a)
--make the "a" a private global variable
local self = {pa = a or 0}
--considered a private method at the moment
local _print = function(b)
print(self.pa)
end
--changes print from a private function to a public method
return {print=_print}
end
foo = create_foo(5)
foo.print()
--[[
--prints nill
print(foo.pa)
--]]
|
output => 5
Equivalent Python 3 Code
Equivalent C++ Code
Equivalent Java Code
Equivalent C# Code
Inheritance
Notes:
Lua Code
--lua
function create_foo(a)
local self = {pa = a or 0}
local _print = function(b)
print(self.pa)
end
return {print=_print}
end
function create_bar(o,b)
local self = {pb = b or 0}
--BAR inherits values from FOO
local temp = o
--add additional functions over inherited functions
temp.get_b = function()
return self.pb
end
temp.set_b = function(c)
self.pb = c
end
return temp
end
bar = create_bar(create_foo(5),10)
bar.print()
print(bar.get_b())
--[[
--prints nil
print(bar.pb)
--]]
|
output => 5
10
Equivalent Python 3 Code
Equivalent C++ Code
Equivalent Java Code
Equivalent C# Code
Made this game for fun to learn Lua Programming Language.
My first game in Pico-8. My first game in Lua. One day challenge fun!
Made this in about 4 and half hours of my time. Although I am a seasonal programmer and also a Game Development Instructor in which my job requires me to make new Video Games on a daily basis. On average I have to make 3 mini-games a week. During summer up to 5 a week. It took me 10+ years to get to this point so please do not feel discouraged I used to suck at programming at one time.
I am used to huge languages like C++ and also C#/Java.
Analysis of Lua is that its a descent small language that can be learned entirely by a seasonal professional like me between 30-60 minutes. Its pretty amazing how awesome this language is how awesome Pico-8 is. I am impressed. C# takes about 5 years to master. C++ almost 9 years. This was not an easy task compared to Lua. It took me longer to learn Scratch (drag and drop programming is not quite there yet).




  3 comments