• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 21:51
CEST 03:51
KST 10:51
  • 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
[ASL20] Ro8 Preview Pt2: Holding On7Maestros of the Game: Live Finals Preview (RO4)5TL.net Map Contest #21 - Finalists4Team TLMC #5: Vote to Decide Ladder Maps!0[ASL20] Ro8 Preview Pt1: Mile High15
Community News
5.0.15 Balance Patch Notes (Live version)65$2,500 WardiTV TL Map Contest Tournament 151Stellar Fest: StarCraft II returns to Canada11Weekly Cups (Sept 22-28): MaxPax double, Zerg wins, PTR12BSL Season 218
StarCraft 2
General
5.0.15 Balance Patch Notes (Live version) Stellar Fest: StarCraft II returns to Canada Had to smile :) 2024/25 Off-Season Roster Moves SC2 5.0.15 PTR Patch Notes + Sept 22nd update
Tourneys
$2,500 WardiTV TL Map Contest Tournament 15 Stellar Fest Sparkling Tuna Cup - Weekly Open Tournament LANified! 37: Groundswell, BYOC LAN, Nov 28-30 2025 Maestros of The Game—$20k event w/ live finals in Paris
Strategy
Custom Maps
External Content
Mutation # 493 Quick Killers Mutation # 492 Get Out More Mutation # 491 Night Drive Mutation # 490 Masters of Midnight
Brood War
General
[ASL20] Ask the mapmakers — Drop your questions BSL Season 21 Any rep analyzer that shows resources situation? RepMastered™: replay sharing and analyzer site [ASL20] Ro8 Preview Pt2: Holding On
Tourneys
[ASL20] Ro8 Day 4 Small VOD Thread 2.0 [ASL20] Ro8 Day 3 3D!Community Brood War Super Cup №3
Strategy
Current Meta I am doing this better than progamers do. Simple Questions, Simple Answers Cliff Jump Revisited (1 in a 1000 strategy)
Other Games
General Games
Nintendo Switch Thread Dawn of War IV Stormgate/Frost Giant Megathread Path of Exile Liquipedia App: Now Covering SC2 and Brood War!
Dota 2
Official 'what is Dota anymore' discussion LiquidDota to reintegrate into TL.net
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
Community
General
US Politics Mega-thread The Games Industry And ATVI Russo-Ukrainian War Thread Things Aren’t Peaceful in Palestine Canadian Politics Mega-thread
Fan Clubs
The herO Fan Club! The Happy Fan Club!
Media & Entertainment
Anime Discussion Thread Movie Discussion! [Manga] One Piece
Sports
MLB/Baseball 2023 2024 - 2026 Football Thread Formula 1 Discussion TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
Recent Gifted Posts The Automated Ban List BarCraft in Tokyo Japan for ASL Season5 Final
Blogs
Mental Health In Esports: Wo…
TrAiDoS
[AI] Sorry, Chill, My Bad :…
Peanutsc
Try to reverse getting fired …
Garnet
[ASL20] Players bad at pi…
pullarius1
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1843 users

Game proto programming (basic level)

Blogs > 0x64
Post a Reply
0x64
Profile Blog Joined September 2002
Finland4569 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
Finland4569 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
Finland4569 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
Online Event
23:00
L4S: Americas
SteadfastSC354
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
SteadfastSC 354
RuFF_SC2 90
Jaeyun 21
StarCraft: Brood War
NaDa 31
Icarus 2
Dota 2
monkeys_forever475
League of Legends
JimRising 398
Counter-Strike
Stewie2K731
Super Smash Bros
hungrybox416
ArmadaUGS36
Other Games
summit1g7911
Day[9].tv701
C9.Mang0332
Maynarde286
ViBE169
UpATreeSC108
NeuroSwarm78
Models14
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 13 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• Ler45
Other Games
• Scarra1006
• Day9tv701
Upcoming Events
Wardi Open
9h 9m
Online Event
15h 9m
Online Event
1d 9h
[BSL 2025] Weekly
1d 16h
Safe House 2
1d 16h
Sparkling Tuna Cup
2 days
BSL Team Wars
2 days
Team Bonyth vs Team Dewalt
Dewalt vs kogeT
JDConan vs Tarson
RaNgeD vs DragOn
StRyKeR vs Bonyth
Aeternum vs Hejek
Replay Cast
3 days
The PondCast
6 days
Liquipedia Results

Completed

KCM Race Survival 2025 Season 3
Maestros of the Game
HCC Europe

Ongoing

BSL 20 Team Wars
BSL 21 Points
ASL Season 20
CSL 2025 AUTUMN (S18)
Acropolis #4 - TS2
EC S1
ESL Pro League S22
Frag Blocktober 2025
Urban Riga Open #1
FERJEE Rush 2025
Birch Cup 2025
DraculaN #2
LanDaLan #3
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

Upcoming

IPSL Winter 2025-26
SC4ALL: Brood War
BSL Season 21
BSL 21 Team A
RSL Revival: Season 3
Stellar Fest
SC4ALL: StarCraft II
WardiTV TLMC #15
ESL Impact League Season 8
SL Budapest Major 2025
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 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.