• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 13:32
CET 19:32
KST 03:32
  • 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 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10
Community News
RSL Season 3: RO16 results & RO8 bracket12Weekly Cups (Nov 10-16): Reynor, Solar lead Zerg surge1[TLMC] Fall/Winter 2025 Ladder Map Rotation14Weekly Cups (Nov 3-9): Clem Conquers in Canada4SC: Evo Complete - Ranked Ladder OPEN ALPHA12
StarCraft 2
General
RSL Season 3: RO16 results & RO8 bracket SC: Evo Complete - Ranked Ladder OPEN ALPHA RSL Season 3 - Playoffs Preview Mech is the composition that needs teleportation t GM / Master map hacker and general hacking and cheating thread
Tourneys
RSL Revival: Season 3 $5,000+ WardiTV 2025 Championship StarCraft Evolution League (SC Evo Biweekly) Constellation Cup - Main Event - Stellar Fest 2025 RSL Offline Finals Dates + Ticket Sales!
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 500 Fright night Mutation # 499 Chilling Adaptation Mutation # 498 Wheel of Misfortune|Cradle of Death Mutation # 497 Battle Haredened
Brood War
General
Data analysis on 70 million replays A cwal.gg Extension - Easily keep track of anyone soO on: FanTaSy's Potential Return to StarCraft [ASL20] Ask the mapmakers — Drop your questions FlaSh on: Biggest Problem With SnOw's Playstyle
Tourneys
[Megathread] Daily Proleagues Small VOD Thread 2.0 [BSL21] GosuLeague T1 Ro16 - Tue & Thu 22:00 CET [BSL21] RO16 Tie Breaker - Group B - Sun 21:00 CET
Strategy
Current Meta Game Theory for Starcraft How to stay on top of macro? PvZ map balance
Other Games
General Games
EVE Corporation Stormgate/Frost Giant Megathread Path of Exile [Game] Osu! Should offensive tower rushing be viable in RTS games?
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
TL Mafia Community Thread SPIRED by.ASL Mafia {211640}
Community
General
Russo-Ukrainian War Thread US Politics Mega-thread The Games Industry And ATVI Things Aren’t Peaceful in Palestine About SC2SEA.COM
Fan Clubs
White-Ra Fan Club The herO Fan Club!
Media & Entertainment
[Manga] One Piece Movie Discussion! Anime Discussion Thread Korean Music Discussion
Sports
2024 - 2026 Football Thread Formula 1 Discussion NBA General Discussion MLB/Baseball 2023 TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
TL Community
The Automated Ban List
Blogs
The Health Impact of Joining…
TrAiDoS
Dyadica Evangelium — Chapt…
Hildegard
Saturation point
Uldridge
DnB/metal remix FFO Mick Go…
ImbaTosS
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2336 users

Game proto programming (basic level)

Blogs > 0x64
Post a Reply
0x64
Profile Blog Joined September 2002
Finland4591 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
Finland4591 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
Finland4591 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
Next event in 12h 58m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
White-Ra 296
Harstem 294
UpATreeSC 115
IndyStarCraft 93
BRAT_OK 59
MindelVK 23
StarCraft: Brood War
Britney 40744
Rain 2928
Calm 2759
BeSt 394
firebathero 179
Dewaltoss 74
Leta 45
Backho 42
scan(afreeca) 40
Mind 35
[ Show more ]
ToSsGirL 32
HiyA 15
JulyZerg 12
ivOry 6
Dota 2
Gorgc6576
qojqva1969
League of Legends
rGuardiaN29
Counter-Strike
pashabiceps719
fl0m531
Other Games
FrodaN1413
XaKoH 594
B2W.Neo582
DeMusliM420
crisheroes353
mouzStarbuck175
Sick146
RotterdaM122
C9.Mang052
Trikslyr48
SteadfastSC19
Organizations
Dota 2
PGL Dota 2 - Main Stream23670
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 19 non-featured ]
StarCraft 2
• Dystopia_ 1
• sooper7s
• Migwel
• AfreecaTV YouTube
• LaughNgamezSOOP
• IndyKCrew
• intothetv
• Kozan
StarCraft: Brood War
• FirePhoenix9
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• C_a_k_e 4905
• WagamamaTV363
• Ler94
League of Legends
• Nemesis3931
• TFBlade970
Other Games
• imaqtpie594
• Shiphtur224
Upcoming Events
RSL Revival
12h 58m
Classic vs MaxPax
SHIN vs Reynor
herO vs Maru
WardiTV Korean Royale
17h 28m
SC Evo League
17h 58m
IPSL
22h 28m
Julia vs Artosis
JDConan vs DragOn
OSC
22h 28m
BSL 21
1d 1h
TerrOr vs Aeternum
HBO vs Kyrie
RSL Revival
1d 12h
Wardi Open
1d 19h
IPSL
2 days
StRyKeR vs OldBoy
Sziky vs Tarson
BSL 21
2 days
StRyKeR vs Artosis
OyAji vs KameZerg
[ Show More ]
OSC
2 days
OSC
2 days
Monday Night Weeklies
2 days
OSC
3 days
Wardi Open
3 days
Replay Cast
4 days
Wardi Open
4 days
Tenacious Turtle Tussle
5 days
The PondCast
5 days
Replay Cast
6 days
LAN Event
6 days
Liquipedia Results

Completed

Proleague 2025-11-16
Stellar Fest: Constellation Cup
Eternal Conflict S1

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
SOOP Univ League 2025
YSL S2
BSL Season 21
CSCL: Masked Kings S3
SLON Tour Season 2
RSL Revival: Season 3
META Madness #9
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2

Upcoming

BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter 2026: Closed Qualifier
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 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.