Perspective floor

Post your own tutorials, guides and demos.

Post » Thu Mar 05, 2009 2:05 am

A scanline-perspective floor, as seen in old arcades :)

Note: Had a runtime crash on startup before when using a large non-power-of-2 tiledbackground, did not crash in debugmode. Will try to reproduce next week.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Thu Mar 05, 2009 2:19 am

I hate to say this, but it looks like you saved this in .98.9. :P I can't load it.
Moderator
B
97
S
36
G
19
Posts: 1,584
Reputation: 17,692

Post » Thu Mar 05, 2009 2:44 am

yes I did. Had to intall it to test a certain .cap
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Thu Mar 05, 2009 3:02 am

Screeny


floor wraps infinitely, bottom moves faster than top. Top is always locked to background.
To use just insert an object and set the height of a scanline as a private, events take care of the rest. In the screen height=1px, larger looks blockier but is faster (and old-skoolish).

Edit: larger "scanlines" also look better when far from the origin. Texture must be designed accordingly for a more convincing effect.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Thu Mar 05, 2009 5:42 am

That's very cool. Here's a quick vid for those using the correct version:
[url:e236y4qf]http://www.mediafire.com/file/5ymu5zoztzq/PerspectiveFloor.mov[/url:e236y4qf]

Sorry about the watermark - free version of FRAPS
B
2
S
1
G
3
Posts: 39
Reputation: 1,078

Post » Thu Mar 05, 2009 12:12 pm

I wouldn't say it's infinite as it distorted heavily near the end of that demo (movie). I did a similar thing a few weeks ago with the 3D boxes but trying to get it right was a total pain. Then David implemented (or I only just found it) the sprite distortion map. I had the idea of using that to create a never ending scrolling floor which would be in perspective at all times, but I never got round to it... ;)
B
15
S
5
G
7
Posts: 877
Reputation: 5,650

Post » Thu Mar 05, 2009 4:11 pm

hey thanks, desmonaut :)
scrolling is infinite in the sense that it'll never stop scrolling, and the layer with the floor has scrollrate=0%, so the object is rather small. It's intended for brawlers or platformers, but could be used in sidescrolling shooters too.
Of course, distortion becomes severe, and you need a tiling background which I didn't include :)
I noticed that using bigger blocks (or "scanlines") makes it matter less, so either limit scrolling or use bigger blocks. But if you're gonna use small scrolling you'd be better off using box3D or sprite shearing.

I'll post an update with proper floor art next release, gotta make it so I can place more than one of these (currently uses a global for holding the number of required blocks). Tried using scaling and remembered perspective isn't linear, so that's for later too.
Any ideas/examples on changing the terrain? can't remember any old game with this kind of floor that did change the terrain seamlessly.

Is this turnable into a plugin?
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Fri Mar 13, 2009 11:35 pm

got latest cons, and i can't run it :/
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
71
S
19
G
19
Posts: 1,919
Reputation: 16,910

Post » Mon Mar 16, 2009 3:35 am

yeah I used a beta. But no worries, I will update it and post a new version that lets you have more than one at once.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Fri Mar 20, 2009 4:18 pm

can't run it :/
B
14
S
4
G
7
Posts: 83
Reputation: 3,885

Next

Return to Your tutorials & example files

Who is online

Users browsing this forum: No registered users and 1 guest