How do I approach coding a scrolling screen?

Previous topic - Next topic

Ian Price

#15
Quote from: mentalthink on 2011-Nov-16
Sorry for Keednaping the post, I nottice 2 times, when I donwload in this case the project of friend Darkmarkwolf and in Physics 2D engine, the file hast the name index.php...

The demo it´s very preftty, very cool Graphics...


I got that (Index.php) too - I'm using Win7 64Bit and FireFox. Even right-clicking on the name and clicking "Save Link As" it states Index.php. however, you can rename it "Game.rar" and then extract it, it's fine.

Weird.

[EDIT] It's coming along nicely and is much smoother than the last time we saw it :)
I came. I saw. I played.

MrPlow

Quote from: Darmakwolf on 2011-Nov-16
This is my approach to smooth scrolling. This is my game I'm working on called The Legend of Blobo: Castle of Deceit. It works roughly like Symphony of the Night (PSX Castlevania.) Unzip everything and run the program.

Controls
Arrow keys = move / navigate menus
Z = cancel / attack
X = accept / jump
I = inventory
F1 = debug
F3 = display FPS
C = mega jump in debug mode

Let me know if it's the kind of system you're looking for. It is not tile based. It is object based. You can have infinity objects per map, and maps are infinite in size. This is possible at 60 FPS because the game only draws what's on-screen, including animated enemies. Objects can also have transparency and draw priority (e.g, in front of the main character.) Enemies react to objects on the map, such as falling until they hit a solid object or stopping and going another direction when hitting a wall. Objects can also move horizontally and vertically like moving platforms in Mario (this is experimental...) and there is HP and EXP and stats and equipment. It's a work in progress :3


<edit note: the attachment for me for some reason downloads as a .php file... renaming it to .zip allowed me to extract the archive. Maybe it's just a firefox / glb forums bug. lol >

Very nice indeed!
I loved the debugging option F1
Plus the superjump made me dizzy...

Nice and smooth...

So how do you use objects rather than tiles??
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Hatonastick

He would have made his own 'object' system.  Guessing using Types.  There is no built-in object system with GLB.
Mat. 5: 14 - 16

Android: Toshiba Thrive Tablet (3.2), Samsung Galaxy Tab 2 (4.1.2).
Netbook: Samsung N150+ Netbook (Win 7 32-bit + Ubuntu 11.10).
Desktop: Intel i5 Desktop with NVIDIA GeForce GTX 460 (Win 8.1 64-bit).

Zapp

I built a similar engine recently with 5 layers for the background
The layers were drawn in this order and with the exception of Layer 0 they were all 32 x32 tiled
Layer 0 static background (sky)
Layer 1 - distant mountains, scrolls 1 pixel every 8 the character moves.
Layer 2 - distant hills, scrolls 1 pixel every 4 the character moves.
Layer 3 - nearby background detail, moves 1 pixel every 2 the character moves
Layer 4 - background layer that moves 1 pixel for 1 pixel with the character
Layer 5 - Collision layer and ground layer that the player interacts with moves at same rate as character
Layer 6 - Was unused, but would move 2 pixels for every 1 the player moved, so you could have small shrubs and things in the very foreground.

Its a lot of drawcalls, but my computer and my iphone 3g handled it just fine.

Ian Price

I used 11 parallax layers for Shadow Of The Beast on the Wiz. Even on such a weedy machine FPS remained at between 55-60FPS.
I came. I saw. I played.

erico

love the zeppelin... is he on an unique layer?

Ian Price

Quotelove the zeppelin... is he on an unique layer?
Technically no, as it's the only thing that moves independently of the scroll.
I came. I saw. I played.

MrPlow

Brings me back to my Amiga days!! :nw:
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

fuzzy70

Quote from: MrPlow on 2011-Nov-17
Brings me back to my Amiga days!! :nw:

I have never left them  :D :D
"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)