xLIB Examples

Moderator: tr1p1ea

necro
Calc King
Posts: 1619
Joined: Sat 26 Mar, 2005 2:45 am
Location: your shadow

Post by necro »

crzyrbl wrote:kevin's done it again!

Image

hmm...I guess he tried out animated sprites
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4128
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

That is AWESOME i cant believe the speed!!!

I had no idea xLIB could enable things to work so fast!

Like i said on IRC:

But, have i opened up a dark portal, pathing the way for an endless wave of BASIC rpg's that are actually 'playable'???


Hehehehe :).
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
User avatar
Jim e
Calc King
Posts: 2457
Joined: Sun 26 Dec, 2004 5:27 am
Location: SXIOPO = Infinite lives for both players
Contact:

Post by Jim e »

Image
Brute scrolling demo. It's faster than I thought basic could ever do. Note: the SE is a tiny bit faster than that pic, I altered the gif to reflect SE speed as best I could.
Image
necro
Calc King
Posts: 1619
Joined: Sat 26 Mar, 2005 2:45 am
Location: your shadow

Post by necro »

that is pretty cool, I don't get the principal behind it hough...explain it to me?
User avatar
dysfunction
Calc Master
Posts: 1454
Joined: Wed 22 Dec, 2004 3:07 am
Location: Through the Aura

Post by dysfunction »

That's extremely fast! Smoothscrolling is an actual possibility now.
Image


"You're very clever, young man, but it's turtles all the way down!"
User avatar
Jim e
Calc King
Posts: 2457
Joined: Sun 26 Dec, 2004 5:27 am
Location: SXIOPO = Infinite lives for both players
Contact:

Post by Jim e »

Basicly(hehe) this creates a random map(8,1) on the fly and after scrolling 8pixels fills in the missing colomn. If a large map is randomized before hand it's even faster, but predictable.
On the fly:

Code: Select all

AxesOff
real(0
For(X,8,15
For(Y,0,7
Pxl-On(Y,X
End
End
StorePic 0
real(0
{8,1}->dim([A]
While 1
2rand->[A](1,1
2rand->[A](2,1
real(4,2,2,1
2rand->[A](3,1
2rand->[A](4,1
real(4,2,2,1
2rand->[A](5,1
2rand->[A](6,1
real(4,2,2,1
2rand->[A](7,1
2rand->[A](8,1
real(4,2,2,0
real(2,0,0,0,1,8,11,12,0,8,0,0,1
End


pre-randomizing

Code: Select all

AxesOff
real(0
For(X,8,15
For(Y,0,7
Pxl-On(Y,X
End
End
StorePic 0
real(0
abs(randM(8,30)).2->[A]
While 1
For(A,0,18
real(4,2,2,1
real(4,2,2,1
real(4,2,2,1
real(4,2,2,0
real(2,0,A,0,30,8,11,12,0,8,0,0,1
End
End


Of course in practical use you could make a neat asteroids game or have an overhead map scroll video.
Image
User avatar
Madskillz
Calc Wizard
Posts: 745
Joined: Fri 17 Dec, 2004 10:22 pm
Location: Wandering around in the Jungle...
Contact:

Post by Madskillz »

Wow Jim awesome...you too tr1p! Does this mean I will go back to BASIC probably not, but it does at least ensure a bright future for our little BASIC developers...
The Revolution is here...
necro
Calc King
Posts: 1619
Joined: Sat 26 Mar, 2005 2:45 am
Location: your shadow

Post by necro »

well, my code has become unmanagable...so I am going to rewrite it with better documentation for myself
merthsoft
Extreme Poster
Posts: 496
Joined: Tue 21 Dec, 2004 6:49 am
Location: WI

Post by merthsoft »

crzybl is making a Zelda game with xLib, asked for help with scrolling, so I made some programs, and posted them at his Omnimaga forum (link)... But I figured I might as well show them here as well... The scrolling idea is very similar to Jim e's...

Ok, here's what I've done with Zelda style scrolling...
This one has six programs, is faster (can't tell much of a difference in the scree shot, but on calc you can), and is 33 bytes larger (not a whole lot):
Image
This one has three programs, is slower (can't tell much of a difference in the scree shot, but on calc you can), and is 33 bytes smaller (not a whole lot):
Image
And here are the files (one is .rar compressed, one is .zip compressed, both have all files):
Click which one you want on the page...
Shaun
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4128
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

Thats excellent work Merthsoft, very nice indeed :).

Some of the things you guys are cooking up with this are impressing me greatly! :).
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
User avatar
dysfunction
Calc Master
Posts: 1454
Joined: Wed 22 Dec, 2004 3:07 am
Location: Through the Aura

Post by dysfunction »

This is great, I've been doing some experimentation with this myself, as well as pixel-scrolling, and I think 2-pixel scrolling is fast enough for simpler games. I'm also prety sure that I'll use the Zelda-style scrolling for Aura.
Image


"You're very clever, young man, but it's turtles all the way down!"
merthsoft
Extreme Poster
Posts: 496
Joined: Tue 21 Dec, 2004 6:49 am
Location: WI

Post by merthsoft »

Well, check out what I did with it:
Image
That's an older version, now the guy doesn't disappear when you scroll, he goes with the screen :)...
PTI seemed to mess up the HUD at the bottom, it looks better than that...
Shaun
Post Reply