• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 16:06
CET 22:06
KST 06:06
  • 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 Revival - 2025 Season Finals Preview7RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12
Community News
Weekly Cups (Dec 1-7): Clem doubles, Solar gets over the hump1Weekly Cups (Nov 24-30): MaxPax, Clem, herO win2BGE Stara Zagora 2026 announced15[BSL21] Ro.16 Group Stage (C->B->A->D)4Weekly Cups (Nov 17-23): Solar, MaxPax, Clem win3
StarCraft 2
General
RSL Revival - 2025 Season Finals Preview Weekly Cups (Dec 1-7): Clem doubles, Solar gets over the hump Chinese SC2 server to reopen; live all-star event in Hangzhou Maestros of the Game: Live Finals Preview (RO4) BGE Stara Zagora 2026 announced
Tourneys
RSL Offline Finals Info - Dec 13 and 14! Tenacious Turtle Tussle 2025 RSL Offline Finals Dates + Ticket Sales! Sparkling Tuna Cup - Weekly Open Tournament StarCraft2.fi 15th Anniversary Cup
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 504 Retribution Mutation # 503 Fowl Play Mutation # 502 Negative Reinforcement Mutation # 501 Price of Progress
Brood War
General
How Rain Became ProGamer in Just 3 Months BGH Auto Balance -> http://bghmmr.eu/ [BSL21] RO8 Bracket & Prediction Contest BW General Discussion FlaSh on: Biggest Problem With SnOw's Playstyle
Tourneys
[ASL20] Grand Finals [BSL21] RO8 - Day 2 - Sunday 21:00 CET [BSL21] RO8 - Day 1 - Saturday 21:00 CET Small VOD Thread 2.0
Strategy
Simple Questions, Simple Answers Game Theory for Starcraft Fighting Spirit mining rates Current Meta
Other Games
General Games
Dawn of War IV Path of Exile Stormgate/Frost Giant Megathread Awesome Games Done Quick 2026! Nintendo Switch Thread
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
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Mafia Game Mode Feedback/Ideas Survivor II: The Amazon Sengoku Mafia TL Mafia Community Thread
Community
General
Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread US Politics Mega-thread YouTube Thread European Politico-economics QA Mega-thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece Movie Discussion!
Sports
2024 - 2026 Football Thread Formula 1 Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
TL+ Announced Where to ask questions and add stream?
Blogs
How Sleep Deprivation Affect…
TrAiDoS
I decided to write a webnov…
DjKniteX
James Bond movies ranking - pa…
Topin
Thanks for the RSL
Hildegard
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1463 users

Game proto programming (basic level)

Blogs > 0x64
Post a Reply
0x64
Profile Blog Joined September 2002
Finland4599 Posts
September 02 2012 18:12 GMT
#1
Hey guys,
few weeks ago I posted a little programming feature on particles and some of you were happy.
I was writing today a little prototype as a continuation of my tooth-fairy game and started to think that this might be something worth sharing.

When I write a prototype, I tend to create static helper classes.
These are comparable to what some people do in C with some define.h file containing all the game's global variables.
I do it for assets (Textures, Sounds, Musics) and also for SoundManager functions.
During prototyping, I rarely run close to any kind of hardware limitation (Processing power nor memory usage) and this make it easy to use the same sound from different classes without having to play with references, pointers (depending on what language I use).

You will also want to have your assets named something like "tree1.png" "tree2.png" etc...
So you can load it all in a list in one for loop.
In C# XNA:

List<Texture2D> treeList = new List<Texture2D>();

....

for(int i = 0; i < treeAmount; i++)
{
treeList.Add(Load("tree" + i + ".png"));
}

....

And finally in your forest class, something pseudo like this:

for(Allmytree)
{
canvas.Draw(GraphicStorage.treeList[theTreeIWantYay]);
}


.....

Now the question why would you not want to always do that?

In bigger project, you don't want always all the assets loaded at the same time, it is easier to manage what needs to be loaded if the object themselves take care of the loading.

....

I'll try to write short stuff like this every time something pop up to my mind!

Dump of assembler code from 0xffffffec to 0x64: End of assembler dump.
quirinus
Profile Blog Joined May 2007
Croatia2489 Posts
September 02 2012 18:23 GMT
#2
We need more code on TL!

Keep writing. :D
All candles lit within him, and there was purity. | First auto-promoted BW LP editor.
Roe
Profile Blog Joined June 2010
Canada6002 Posts
September 03 2012 04:15 GMT
#3
I've been learning C# on my own, but I find it hard where to start and where to go. There's just so much to learn, and doing it on my own by trial and error is very tedious. I'd love to make little games, or even some program that could perform statistical calculations (damn school program never seems to work). Any advice?
0x64
Profile Blog Joined September 2002
Finland4599 Posts
September 03 2012 15:10 GMT
#4
On September 03 2012 13:15 Roe wrote:
I've been learning C# on my own, but I find it hard where to start and where to go. There's just so much to learn, and doing it on my own by trial and error is very tedious. I'd love to make little games, or even some program that could perform statistical calculations (damn school program never seems to work). Any advice?


Learning programming is quite tricky on your own. You probably need a good book that you can refer to when you have troubles.
something about object oriented programming to understand the heart of C# and something not too big about the syntax.
Read them quickly, just to know what you can find in them and approximately where.
Then just go through examples, modify them, play a lot with them.
Get to write your own classes quite fast, you should lower the psychological threshold of creating a new class.
Dump of assembler code from 0xffffffec to 0x64: End of assembler dump.
Sawamura
Profile Blog Joined August 2010
Malaysia7602 Posts
Last Edited: 2012-09-03 15:48:48
September 03 2012 15:46 GMT
#5
On September 03 2012 03:23 quirinus wrote:
We need more code on TL!

Keep writing. :D


tl should have a coding section we can share and help tl'ers with their codes .

Edit : At Op I am new to C++ although I studied C language before this . Topics like vector and stl are really confusing to me I have gone through some examples from books however I have hard time applying the concept to use it in programs or system I am designing. Would you be kind to point me to a few good books a newbie should go through to have solid fundamental in C++ ?
BW/KT Forever R.I.P KT.Violet dearly missed ..
fanta[Rn]
Profile Blog Joined October 2004
Japan2465 Posts
Last Edited: 2012-09-03 18:09:10
September 03 2012 18:08 GMT
#6
vector is just a datastructure similar to an array but more convenient (resizes automatically, remove items, searchable, etc.)
0x64
Profile Blog Joined September 2002
Finland4599 Posts
September 03 2012 20:07 GMT
#7
Don't know anymore books about C++.
Yeah Vector is a very confusing and scary name for many.

Dump of assembler code from 0xffffffec to 0x64: End of assembler dump.
Please log in or register to reply.
Live Events Refresh
BSL 21
20:00
RO8 - Day 2
Tech vs Cross
Bonyth vs eOnzErG
ZZZero.O287
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
mouzHeroMarine 480
IndyStarCraft 172
JuggernautJason106
DisKSc2 32
UpATreeSC 17
StarCraft: Brood War
Britney 15990
Calm 2366
Shuttle 469
Mini 334
ZZZero.O 287
EffOrt 181
Dewaltoss 75
ggaemo 62
Dota 2
Gorgc5417
420jenkins222
LuMiX1
Counter-Strike
fl0m9737
byalli549
Super Smash Bros
hungrybox130
Heroes of the Storm
Khaldor533
Liquid`Hasu484
Other Games
Grubby4342
B2W.Neo544
ArmadaUGS155
Fuzer 81
OptimusSC21
Organizations
Other Games
gamesdonequick1521
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 17 non-featured ]
StarCraft 2
• HeavenSC 44
• sitaska23
• Adnapsc2 20
• Migwel
• AfreecaTV YouTube
• sooper7s
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
StarCraft: Brood War
• Airneanach27
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• WagamamaTV506
Other Games
• imaqtpie2468
• Shiphtur575
Upcoming Events
Replay Cast
11h 54m
Wardi Open
14h 54m
Monday Night Weeklies
19h 54m
Sparkling Tuna Cup
1d 12h
OSC
2 days
YoungYakov vs Mixu
ForJumy vs TBD
Percival vs TBD
Shameless vs TBD
Replay Cast
3 days
The PondCast
3 days
OSC
4 days
CranKy Ducklings
5 days
SC Evo League
5 days
[ Show More ]
BSL 21
5 days
Sparkling Tuna Cup
6 days
BSL 21
6 days
Liquipedia Results

Completed

Acropolis #4 - TS3
RSL Revival: Season 3
Kuram Kup

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
YSL S2
BSL Season 21
Slon Tour Season 2
WardiTV 2025
META Madness #9
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22

Upcoming

CSL 2025 WINTER (S19)
BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
Big Gabe Cup #3
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 2025
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.