• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 10:59
CEST 16:59
KST 23:59
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
RSL Season 1 - Final Week6[ASL19] Finals Recap: Standing Tall12HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16Code S RO4 & Finals Preview: herO, Rogue, Classic, GuMiho0
Community News
Weekly Cups (July 7-13): Classic continues to roll2Team TLMC #5 - Submission extension1Firefly given lifetime ban by ESIC following match-fixing investigation17$25,000 Streamerzone StarCraft Pro Series announced7Weekly Cups (June 30 - July 6): Classic Doubles7
StarCraft 2
General
RSL Revival patreon money discussion thread Weekly Cups (July 7-13): Classic continues to roll Esports World Cup 2025 - Final Player Roster TL Team Map Contest #5: Presented by Monster Energy Team TLMC #5 - Submission extension
Tourneys
FEL Cracov 2025 (July 27) - $8000 live event RSL: Revival, a new crowdfunded tournament series $5,100+ SEL Season 2 Championship (SC: Evo) WardiTV Mondays Sparkling Tuna Cup - Weekly Open Tournament
Strategy
How did i lose this ZvP, whats the proper response Simple Questions Simple Answers
Custom Maps
External Content
Mutation # 482 Wheel of Misfortune Mutation # 481 Fear and Lava Mutation # 480 Moths to the Flame Mutation # 479 Worn Out Welcome
Brood War
General
Flash Announces Hiatus From ASL BW General Discussion A cwal.gg Extension - Easily keep track of anyone [Guide] MyStarcraft [ASL19] Finals Recap: Standing Tall
Tourneys
CSL Xiamen International Invitational [BSL20] Non-Korean Championship 4x BSL + 4x China [Megathread] Daily Proleagues 2025 ACS Season 2 Qualifier
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Nintendo Switch Thread Stormgate/Frost Giant Megathread Path of Exile CCLP - Command & Conquer League Project The PlayStation 5
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread HOW TO HIRE A HACKER TO RECOVER STOLEN BITCOIN. Russo-Ukrainian War Thread Summer Games Done Quick 2025! Things Aren’t Peaceful in Palestine
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
Movie Discussion! [Manga] One Piece Anime Discussion Thread [\m/] Heavy Metal Thread
Sports
2024 - 2025 Football Thread Formula 1 Discussion NBA General Discussion TeamLiquid Health and Fitness Initiative For 2023 NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
Men Take Risks, Women Win Ga…
TrAiDoS
momentary artworks from des…
tankgirl
from making sc maps to makin…
Husyelt
StarCraft improvement
iopq
Trip to the Zoo
micronesia
Customize Sidebar...

Website Feedback

Closed Threads



Active: 622 users

Student Game Dev Part 18 - Layers and music

Blogs > Soan
Post a Reply
Soan
Profile Blog Joined August 2010
New Zealand194 Posts
March 28 2014 01:01 GMT
#1
+ Show Spoiler [Previous parts] +
Part One - It begins
Part Two - Technical Foundation
Part Three - Game Design
Part Four - Input and Physics
Part Five - More Physics Things
Part Six - Even More Physics
Part Seven - User Interface
Part Eight - UI and the Editor
Part Nine - Editor Progress
Part Ten - Progress, and videos
Part Eleven - Fixing the Physics
Part Twelve - Unproductive
Part Thirteen - Context menu + enemies
Part Fourteen - Enemies and Problems
Part Fifteen - Play testing
Part Sixteen - Editor and Art
Part Seventeen - Video!


This Week
Hello again TeamLiquid! Welcome back to my blog about the development of The Adventures of Sam the Pirate, the 2D platformer I'm creating as the final game project for my Bachelor of Software Engineering degree. Last week</a> I talked about getting moving platforms to work properly, and had a new video. This week I'll be talking about getting some parallax scrolling working, and talking a bit about music for the game.

Background layers
Got a base for background layers, behind the level, working this week. Should help to make levels a bit more visually interesting, I just need some actual art pieces to populate the backgrounds, instead of my terrible programmer art. These background objects can be a static image, or an animated sprite, completely stationary independently moving left or right. So for example there could be a layer consisting of distant clouds, a layer in front of that with some hills, and then another layer in front of that consisting of more closer clouds.

The background items are positioned in an area the same size as the level, so at the moment they scroll past at the same speed as objects in the level. This means that anything which is meant to be in the distance and so scroll past slower, don't do that, so it's not correct parallax scrolling just yet. This would definitely throw off the illusion for anything meant to be in the distance, as they won't be moving at the same speed, but I'm not too sure I have time to try and fix this just yet.

To fix it, and implement proper parallax scrolling, I need to make background layers scroll past at different speeds, rather than at the same speed. One method I've been thinking of, is to change the scale of the layer. At the moment, the scale is the same as the size of the level, so if the level is 10,000 x 2,000 pixels, the layer is the same. I could shrink that size for layers that are further away, and then scroll appropriately. Maybe I could achieve this effect by doing some hacky maths with the positions of objects and the camera position.

Not really sure, but I'm leaving it as is for now, as I only have 7 weeks left so I'm moving on to other elements that still need implementing. Might have a little look at it today, and otherwise come back to it later if I have time.

Music
Had someone offer to create music and sound via the games Facebook page during the week as well, which is great! He's already created a couple of sample tracks, and you can listen to a potential theme for the ship/beach levels below:

Oops, looks like your browser doesn't support the audio tag yet. You can download the file manually: http://swashbucklinstudios.com/wp-content/uploads/2014/03/Ship-Theme.mp3

It definitely has the catchiness that I'm looking for in game music to have, so we'll have to see what else he comes up with. If you're interested, he has a website over at Eternal Vibration that you can check out.

What's next?
Next week I'll be adding water to the editor, and get it functioning in game, so that the player dies if they fall into it, as Sam is a terrible pirate who can't swim. I'll potentially be looking at adding coins, along with score tracking and display. Depending on how things go over the next few weeks, I'm thinking of putting a 10 level demo version up for download too. No promises on that though!

Keep up to date!
Be sure to follow me on Twitter, and like the Facebook page to stay up to date on future content and blog posts when they happen. If you have any questions don't hesitate to ask, either through Twitter or Facebook! You can also check out the blog, previous posts, screenshots and videos over at my site.

EatThePath
Profile Blog Joined September 2009
United States3943 Posts
March 28 2014 08:04 GMT
#2
Are your backgrounds supposed to tessellate? Just have them scroll at a speed that scales with a "how far in the distance" parameter, which goes from 1 to infinity and just multiplies as 1/x. So the foreground has a parameter of 1 and something in the middle distance is 2 or 3 and something far away is 10, so it goes by at 1/10th the speed.

I haven't read your other blogs but I'll check it out to see if I can give a more appropriate explanation based on your engine.



That music is ballin.
Comprehensive strategic intention: DNE
Soan
Profile Blog Joined August 2010
New Zealand194 Posts
March 28 2014 23:13 GMT
#3
I think I figured it out. I'm just using a scale between 0 and 1, and multiplying the cameras position (which changes which part of the level is being viewed, and causes the scrolling effect of the level), by that. So 0 is a static background, at a far distance, closing in to 1 being the level itself.
EatThePath
Profile Blog Joined September 2009
United States3943 Posts
March 29 2014 02:07 GMT
#4
That makes sense. ^^
Comprehensive strategic intention: DNE
Please log in or register to reply.
Live Events Refresh
Wardi Open
11:00
#44
WardiTV1675
OGKoka 1058
Rex159
CranKy Ducklings150
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
OGKoka 1058
Rex 159
StarCraft: Brood War
PianO 5140
Rush 1883
Sea 1611
firebathero 1558
EffOrt 1273
JulyZerg 1083
zelot 703
Larva 666
Stork 626
Mong 488
[ Show more ]
Mini 315
Mind 146
Zeus 117
ToSsGirL 104
sorry 93
Pusan 82
Barracks 78
Movie 66
Shinee 56
sSak 47
soO 41
Shine 40
Terrorterran 31
sas.Sziky 31
Rock 16
IntoTheRainbow 9
yabsab 8
Bale 7
SilentControl 7
NaDa 4
Stormgate
NightEnD30
Dota 2
qojqva3439
syndereN585
League of Legends
Dendi1601
febbydoto7
Counter-Strike
flusha479
Super Smash Bros
Mew2King94
Heroes of the Storm
Khaldor219
Other Games
singsing2817
hiko1314
Fuzer 685
crisheroes456
Beastyqt353
Lowko288
oskar233
XcaliburYe233
Hui .224
Liquid`VortiX181
KnowMe103
ArmadaUGS99
QueenE51
Trikslyr1
Organizations
Other Games
gamesdonequick5050
StarCraft: Brood War
Kim Chul Min (afreeca) 7
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 13 non-featured ]
StarCraft 2
• StrangeGG 58
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• C_a_k_e 2532
League of Legends
• Nemesis6008
Upcoming Events
RotterdaM Event
1h 1m
Replay Cast
19h 1m
WardiTV European League
1d 1h
ShoWTimE vs sebesdes
Percival vs NightPhoenix
Shameless vs Nicoract
Krystianer vs Scarlett
ByuN vs uThermal
Harstem vs HeRoMaRinE
PiGosaur Monday
1d 9h
uThermal 2v2 Circuit
2 days
Replay Cast
2 days
The PondCast
2 days
Replay Cast
3 days
Epic.LAN
3 days
CranKy Ducklings
4 days
[ Show More ]
Epic.LAN
4 days
BSL20 Non-Korean Champi…
5 days
Bonyth vs Sziky
Dewalt vs Hawk
Hawk vs QiaoGege
Sziky vs Dewalt
Mihu vs Bonyth
Zhanhun vs QiaoGege
QiaoGege vs Fengzi
Sparkling Tuna Cup
5 days
Online Event
6 days
BSL20 Non-Korean Champi…
6 days
Bonyth vs Zhanhun
Dewalt vs Mihu
Hawk vs Sziky
Sziky vs QiaoGege
Mihu vs Hawk
Zhanhun vs Dewalt
Fengzi vs Bonyth
Liquipedia Results

Completed

2025 ACS Season 2: Qualifier
RSL Revival: Season 1
Murky Cup #2

Ongoing

JPL Season 2
BSL 2v2 Season 3
CSL 17: 2025 SUMMER
Copa Latinoamericana 4
Jiahua Invitational
BSL20 Non-Korean Championship
Championship of Russia 2025
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25
BLAST Rivals Spring 2025
MESA Nomadic Masters

Upcoming

CSL Xiamen Invitational
CSL Xiamen Invitational: ShowMatche
2025 ACS Season 2
CSLPRO Last Chance 2025
CSLPRO Chat StarLAN 3
BSL Season 21
K-Championship
RSL Revival: Season 2
SEL Season 2 Championship
uThermal 2v2 Main Event
FEL Cracov 2025
Esports World Cup 2025
Underdog Cup #2
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.