ËNVY (LÖVE Framework)

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
Kuromeku
Party member
Posts: 166
Joined: Sun Jul 20, 2008 5:45 pm

Re: ËNVY (LÖVE Framework)

Post by Kuromeku »

I done did made my own GUI library for ËNVY.

Code: Select all

	LOL_PANEL = envy.control.add("panel");
	LOL_PANEL:setPosition( envy.vector:new(256, 256) );
	LOL_PANEL:setSize(256, 256);
	
	LOL_PANEL2 = envy.control.add("button");
	LOL_PANEL2:setSize(512, 256)
	LOL_PANEL2:setCallback(function() envy.console.print("cock") end)
	LOL_PANEL2:setParent(LOL_PANEL)
	LOL_PANEL2:setColor(255, 50, 50, 255);
	LOL_PANEL2:setPosition( envy.vector:new(8, 8) );
	LOL_PANEL2:getLabel():setText("HAI GUYZ")
	LOL_PANEL2:sizeToContents()
	LOL_PANEL:sizeToContents()
Works beautifully.
User avatar
Borsty
Citizen
Posts: 66
Joined: Sun Oct 19, 2008 10:29 pm
Location: Hamburg, Germany
Contact:

Re: ËNVY (LÖVE Framework)

Post by Borsty »

That's like exactly how lgui works :V
User avatar
Kuromeku
Party member
Posts: 166
Joined: Sun Jul 20, 2008 5:45 pm

Re: ËNVY (LÖVE Framework)

Post by Kuromeku »

This is the first time I've ever attempted networking in my life :O

SERVER:

Code: Select all

function GAME:sendEntities(ip)
	for k, v in pairs(envy.entity.spawned) do
		self.server:send("entity", ip);
			self.server:send("x:"..v:getX(), ip);
			self.server:send("y:"..v:getY(), ip);
			self.server:send("a:"..v:getAngle(), ip);
			self.server:send("c:"..v:getClass(), ip);
		self.server:send("entity", ip);
	end;
end;
CLIENT:

Code: Select all

function GAME.onNetworkReceive(data, ip, port)
	if (data == "entity") then
		if (GAME.currentEntity) then
			if (not GAME.currentEntity.index) then
				local entity = envy.entity.add(GAME.currentEntity.class);
				
				-- Set some information about the entity.
				entity:setPosition( envy.vector:new(GAME.currentEntity.x, GAME.currentEntity.y) );
				entity:setAngle(GAME.currentEntity.angle);
				entity:spawn();
			elseif ( envy.entity.spawned[GAME.currentEntity.index] ) then
				if (GAME.currentEntity.x) then
					envy.entity.spawned[GAME.currentEntity.index]:setX(GAME.currentEntity.x);
				end;
				if (GAME.currentEntity.y) then
					envy.entity.spawned[GAME.currentEntity.index]:setY(GAME.currentEntity.y);
				end;
				if (GAME.currentEntity.angle) then
					envy.entity.spawned[GAME.currentEntity.index]:setAngle(GAME.currentEntity.angle);
				end;
			end;
			
			-- Set the current entity table to nil.
			GAME.currentEntity = nil;
		else
			GAME.currentEntity = {};
		end;
	elseif (GAME.currentEntity) then
		if (string.sub(data, 1, 2) == "x:") then
			GAME.currentEntity.x = tonumber( string.sub(data, 3) );
		elseif (string.sub(data, 1, 2) == "y:") then
			GAME.currentEntity.y = tonumber( string.sub(data, 3) );
		elseif (string.sub(data, 1, 2) == "a:") then
			GAME.currentEntity.angle = tonumber( string.sub(data, 3) );
		elseif (string.sub(data, 1, 2) == "c:") then
			GAME.currentEntity.class = string.sub(data, 3);
		elseif (string.sub(data, 1, 2) == "i:") then
			GAME.currentEntity.index = tonumber( string.sub(data, 3) );
		end;
	end;
end;
Image
1stAnd10
Prole
Posts: 22
Joined: Tue Nov 25, 2008 2:09 pm

Re: ËNVY (LÖVE Framework)

Post by 1stAnd10 »

This is fantastic, thanks for all your hard work on this.

When is version 11 going to get posted so I can play with GUI stuff? ;)

*bangs on table for more*
User avatar
Kuromeku
Party member
Posts: 166
Joined: Sun Jul 20, 2008 5:45 pm

Re: ËNVY (LÖVE Framework)

Post by Kuromeku »

The network stuff won't be ready till like PHASE 22 or something, I want it to be really good, and I want to wait until LUBE is ready.

And as for the GUI stuff, me and Borsty are working on a little something at the moment and then I'll release it soon.
1stAnd10
Prole
Posts: 22
Joined: Tue Nov 25, 2008 2:09 pm

Re: ËNVY (LÖVE Framework)

Post by 1stAnd10 »

Thanks for the update. :)
User avatar
qubodup
Inner party member
Posts: 775
Joined: Sat Jun 21, 2008 9:21 pm
Location: Berlin, Germany
Contact:

Re: ËNVY (LÖVE Framework)

Post by qubodup »

Hehe, apparently Kudomiku is as hyperactive as he is, because he wants to reserve all the cool names for his projects ;)
lg.newImage("cat.png") -- made possible by lg = love.graphics
-- Don't force fullscreen (it frustrates those who want to try your game real quick) -- Develop for 1280x720 (so people can make HD videos)
User avatar
Borsty
Citizen
Posts: 66
Joined: Sun Oct 19, 2008 10:29 pm
Location: Hamburg, Germany
Contact:

Re: ËNVY (LÖVE Framework)

Post by Borsty »

Meh, can't be arsed to upload it somewhere so I'll post it here xD
For increasing the trace-lib's performance I was working on a line - quadtree today. Here's what it looks like when it's processing the boxes xD
Attachments
envy_shadow.love
just a test
(341.11 KiB) Downloaded 202 times
User avatar
Kuromeku
Party member
Posts: 166
Joined: Sun Jul 20, 2008 5:45 pm

Re: ËNVY (LÖVE Framework)

Post by Kuromeku »

Image

Version: Phase 11.
Download: http://kudomiku.com/dump/lua/envy/envy.love.
Changelog:

Code: Select all

[Phase 11]
   * Added envy.util.getSound and envy.util.newMusic and envy.util.getImage.
   * Added envy.util.isBetween(value, minimum, maximum).
   * Added envy.vector.class:angleBetween(vector).
   * Added envy.vector.class:moveTowards(angle, speed).
   * Added envy.vector.class:moveAtAngle(angle, speed).
   * Added envy.vector.class:rotate(angle).
   * Added envy.entity.class:addVelocity(velocity) (adds to the entity's velocity).
   * Added envy.entity.include(file).
   * Added envy.entity.includeAll(directory).
   * Added envy.control.include(file).
   * Added envy.control.includeAll(directory).
   * Added envy.util.enumerate(directory);
   * Added envy.util.include(file);
   * Added envy.trace.class:setName(name).
   * Added envy.trace.class:getName().
   * Added envy.util.reverseTable(base).
   * Added anything in game/entities/ is included automatically.
   * Added anything in game/controls/ is included automatically.
   * Added if you return true on a GAME hook, the normal hooks will not run.
   * Added if you return true on a hook, the rest of the hooks will not run.
   * Added canTraceHit hook for entities (return false to disallow the trace to hit it).
   * Added onInitialize hook for entities.
   * Added onHookError hook.
   * Added canPressKey and canPressMouse hooks (return false to disallow).
   * Added onDrawControls hook.
   * Added the envy.control library.
   * Added the envy.module library.
   * Changed onMousePressed and onMouseReleased arguments to (button, position).
   * Changed the way entities work you no longer need to define ENTITY and register it in the file. This is done automatically
when it is included.
Delete your current ËNVY installation before installing the new one! You don't need to delete your game folder!
1stAnd10
Prole
Posts: 22
Joined: Tue Nov 25, 2008 2:09 pm

Re: ËNVY (LÖVE Framework)

Post by 1stAnd10 »

Kudomiku do you have a function in ENVY that returns the dot product? If not that could be really useful. I'm just starting out with vector math and one thing XNA had was a math.dot function that I used a lot. I can live without it but just a suggestion while your adding other useful stuff.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests