AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Tutorial 2.8: Recap

Ein Thema von DP News-Robot · begonnen am 14. Apr 2020
Antwort Antwort
Benutzerbild von DP News-Robot
DP News-Robot

Registriert seit: 4. Jun 2010
15.392 Beiträge
 
#1

Tutorial 2.8: Recap

  Alt 14. Apr 2020, 00:01
We created GxImages, a library, Entities, SpriteAnimations, and what else. By now, I can imagine you might be confused with all the different classes. Who is doing what?





First try to make a difference between “data” and “entities”. Data can be an image, a sound file, or an animation description (how fast, which frames, what next, …). A 3D model, level structure, a shader, and so on. Data tends to eat relative much memory, so we only want to load it once. Or even better, only when needed, on demand. Since the engine itself doesn’t know what we want to load, a “Resources” file has been added to the game code, doing that.


Entities are instances, using that data. They can come in great numbers, like the 20 bonus crates or foes on screen. Multiple entities may refer to the same Data resources. So far we only made a very abstract base entity, and another still pretty global “Sprite” entity. The latter refers to an Image and can play an animation.


First, we fill our ImageLibrary with Images, which are Atlas Textures, meaning a single image file can contain multiple subimages, referred as “regions”. Second, we define animation data. An animation tells which image to use, and each animation frame is linked to a region of that image (atlas). Also non-animated sprites, like a simple rock picture, are treated in the same way here. But only using a single frame.


Entities are made and inserted into the EntitySystem, which updates them every cycle until the entity tells to quit (“kills itself”). If an entity update() function returns false, we shoot it, cut it in pieces, throw it in the trunk, eat spaghetti with mom, then burry it in a forest.






Got it? Good. Now let’s put this thing to action. We’re going to clean up the Game code, and make more use of the engine to … to get the same stupid orb. Joy.


So… You’re saying we did ALL this work for the same Orb? Something we had programmed within the first 10 minutes already? Ehm, yes. C’est bon, oui? Engine programming is a lot of work indeed. You could have cheated as well, and take the short route.


But remember those times when you used to buy flowers and cook for your girl? You could just as well buy her a bigMac and sit in the couch, but that won’t be rewarded on the long term. Quid pro quo, my friend.


Trust me, we made solid basis for further operations here. Lots of sweat digging out all those trenches, but now we are better protected for the Vietcong. All the studying late nights, but now we’re going to get filthy rich. Now we shall harvest.


Weiterlesen...
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 07:34 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz