Log In  
Follow
peymanx

Hey, I am PEYMANx


Cart #paddle_mario-0 | 2022-10-24 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

Ok,
This is my second game...
Pico8 is reallllly fun

Source code at Github:

https://github.com/peymanx/paddle_mario_game

🤩 HAVE FUN

2
0 comments



Cart #mario_vs_khabis-1 | 2022-10-22 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

What's up guys
I made a video to explain how Lua works - in Persian
and this game is the result
only in 20min you can make a wonderful game

In Persian "khabis" means bad guy.
Khabis and mario try to get fruits and avoid bombs.
a simple senario and addictive game :)

Collision Detection
In physics, a collision is any event in which two or more bodies exert forces on each other in a relatively short time.

function collision(a,b,x,y)
    if (a <= x and a+8 >=x or 
            x <= a and x+8 >=a) and
                (b <= y and b+8 >=y or 

[ [size=16][color=#ffaabb] [ Continue Reading.. ] [/color][/size] ](/bbs/?pid=119095#p)
1 comment



Cart #px_puzzle-1 | 2022-10-14 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

First I load my image to a table,
final positions in x,y and random position in (a,b)

function load_image()

	--load the image
	me = {}
	for j=0,8 do
	 row={}
		for i=0,8 do
					add(row,{
					 spr=j*16+i,
					 x=i*8+30,
					 y=j*8+20,
					 a=rnd(150),
					 b=130,
					})
  end
  add(me, row)

	end

end

then I call a magnet() function to move a=>x and b=>y

function magnet()
  local step=1

		for j=1,8 do

				for i=1,8 do
				  local p = me[j][i]
				  x= p.a
				  y= p.b
						if p.a > p.x then
							p.a-=step
						end
						if p.a < p.x then
							p.a+=step
						end
						if p.b > p.y then
							p.b-=step

[ [size=16][color=#ffaabb] [ Continue Reading.. ] [/color][/size] ](/bbs/?pid=119089#p)
2
2 comments