Graphic layers?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
osgeld
Party member
Posts: 303
Joined: Sun Nov 23, 2008 10:13 pm

Re: Graphic layers?

Post by osgeld »

I had an apple //e since before i can remember to the mid 90's

I am working with stick os (basic) for 32 bit microcontrollers

And also working out a apple //e game for retro challenge 2k9

I am pretty sure I HATE FREAKIN BASIC!

lua is nice, its like basic but not retarded so i am happy with it
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Graphic layers?

Post by Jasoco »

Code: Select all

RANDOMIZE TIMER
SCREEN 7
DO
    X = 20 * RND + 1
    Y = 25 * RND + 1
    LOCATE X, Y
    PRINT "BASIC's not all bad";
LOOP
User avatar
osgeld
Party member
Posts: 303
Joined: Sun Nov 23, 2008 10:13 pm

Re: Graphic layers?

Post by osgeld »

Code: Select all

10 FOR N = 1 TO 500
20 ? "BASIC SUX";
30 NEXT N
RUN
course I have not gotten into the nice luxurious modern basic's, that above is for AS Integer basic which was released in 1977, and stick os is still stuck in the stone age as far as basics go, but its much nicer if when you want to just play around and explore a microcontroller rather than using C and compiling and flashing just to find out you had a boo-boo (and you can only flash these things so many times)

Bout as new as i ever got was qbasic on dos, maybe I should try some new forms of it before stating an opinion of it in the modern world
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Graphic layers?

Post by Jasoco »

I used QuickBASIC back in the mid 90's when our Windows PC died and I was forced to use our old 286 for a few months. Since all it had was some crappy games and whatever came in DOS I taught myself QBASIC.

Thankfully LÖVE came along to free me from the binds of BASIC.

LÖVE has set me free.
User avatar
osgeld
Party member
Posts: 303
Joined: Sun Nov 23, 2008 10:13 pm

Re: Graphic layers?

Post by osgeld »

Jasoco wrote:LÖVE has set me free.
agreed, lua is a great scripting language and love is a great implementation of that language
Arthurio
Prole
Posts: 8
Joined: Sun Jul 12, 2009 7:12 pm

Re: Graphic layers?

Post by Arthurio »

bartbes wrote:For only drawing inside the visual area take a look at love.graphics.setScissor.
I tested that ... setScissor is nice but setScissor + not calling a .draw function at all = much much better performance. So much better in fact that using only setScissor has almost no impact in comparison.

This simple function helps alot:

Code: Select all

camera = {x=0, y=0}
screen = {x1=10, y1=10, x2=790, y2=590}

function inScreen(x, y, w, h)
	
	return x-w+camera.x < screen.x2 and y-h+camera.y < screen.y2 and x+w+camera.x > screen.x1 and y+h+camera.y > screen.y1
	
end
For really big maps tho ... you really need something like quadtree http://en.wikipedia.org/wiki/Quadtree . Not sure about performance but I would guess that a binary library might work best. - hmm note to self: interesting project

About using lua for game logic: I think it's perfect tool for the job as long as you don't try to do any big data manipulation with it. My tests showed that about 150 000 calculations per update is the limit for a powerful cpu but that's subjective ofc.
Raider
Prole
Posts: 11
Joined: Fri Jul 31, 2009 12:49 pm

Re: Graphic layers?

Post by Raider »

..wait a second.

I haven't read all the topic, but are we wanting pixel access that updates efficiently with a GPU texture?

And efficient copies between ram?

I have code that could be useful. It's in C++; it uses memcpy for between-ram copies and "mark as dirty" tile based synchronization for efficient texture sync. It can paste subimages (GL speak for rectangular selections) or just directly access pixels.

Having figured out the potential hazards and having working code, may I help with this if I can?
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 218 guests