Log In  
Follow
WDDETER

I've struggled with collision for a long time, but I've discovered/learned two collision types that can be implemented into just about any game genre.

This is my first time writing a tutorial so please any advice or mistakes a must.

Some background:

What is an object? An object can be something as simple as you having to make a tabel/array of said thing.

And what is a tile? A tile refers to what you place down in the tile-map which is the brick icon at the top.

A flag is something you can set in the sprite creator. It's the row of 8 buttons underneath the color palette.
The reason for these buttons is for easier management of sprites, if you want to have a block that damages the player you can set a flag for that. Or in this context for a solid wall.

PROBLEMS AND SOLUTIONS OF THESE COLLISIONS WILL BE LOCATED AT THE BOTTOM

OBJECT-TO-OBJECT COLLISION

This collision type involves four to eight parameters.

  • A first X value (x1)

[ Continue Reading.. ]

1
4 comments



I've been trying for a day to figure this out and I can't. There's barely any information online about this. Although it feels like everyone knows it but me.

My idea is on initialize to run a nested for loop and add any enemies to a list. And in the update move them.
I did this and it worked! But it incremented in grids. There's no actual code of this since I deleted it, but I could easily reprogram it, if someone asks what the block was.

1
5 comments



Hello, I'm currently testing to see if I can do 3D. And I have a square with 2 polygons, but to make it 3D and apply a rotation matrix I would have to make a Z value. I have no idea how to do that. Any help appreciated!

polygons = 
{ 
	{ verts = {{x=40, y=40}, {x=80, y=40}, {x=80, y=80}} },
	{ verts = {{x=40, y=40}, {x=40, y=80}, {x=80, y=80}} }
}

function _init()
end

function _update()
end

function _draw()
	cls()	

	for i = 1, #polygons do
		if polygons[i] and polygons[i].verts then
			_drawPolygon(polygons[i])
		end
	end
end

function _drawPolygon(polygon)
	local total_verts = #polygon.verts
	for i = 1, total_verts do
		local next_vert = (i % total_verts) + 1
		local x1, y1 = polygon.verts[next_vert].x, polygon.verts[next_vert].y
		local x2, y2 = polygon.verts[i].x, polygon.verts[i].y
		line(x1, y1, x2, y2, 7)	
	end
end
1 comment



Hello everyone! I'm wondering how I could have multiple animations? Like an idle, walking, running, etc. The problem is that when I run (which is the else) It goes through the whole animation sheet, I know why but have no clue how to tackle.

Responses much appreciated!

	-- player anim
	if not pl.wlk then
		if pl.sp <= 4 then
			pl.sp+=0.01
		else
			pl.sp=1
		end
	else
		if pl.sp <= 6.9 then
			pl.sp+=0.1
		else
		 pl.sp=5
		end
	end
2 comments



Just need some solutions.

0 comments



Hello everyone! I've been confused for a long time, on how to make multiple pickups items using the same collision function. I want to use the map editor to place them, but give different values to them for example.
A healing potion: +5 health points
A gold coin: +2 money
Instead of all of them just giving +1. Thank you!

2 comments



Hello everyone, how do I combat my sprite sheet, page 2 and 3, altering the lower part of the map, do they share the same data perhaps?
Is it not fixable at all? Please I am open to any response disappointing, or relieving. Thanks in advance.

2 comments