‫هيهين‬


        http://a-saker.blogspot.com
        http://e-saker.blogspot.com
‫الوحتوى‬

           ‫• مقدمة في تطوير األلعاب‬

‫• ‪Component-Based Architecture‬‬

               ‫• تطبيق على ‪Unity‬‬
‫التعلين التواسي‬

 ”Tangential Learning”
‫صناعة األلعاب‬



                                          Vs


           $239 million                               $500 million
       First Week Revenue                         First Week Revenue
Source : Video Game Industry Trends by Ferrarra
‫األلعاب‬
‫الوحتوي‬



                   ‫التفاعلية‬



‫الفوز واخلسارة‬       ‫املشاركة‬   ‫القدرة على االختيار‬
Source : Learning To Make Your Own Reality by Jane McGonigal
‫األلعبة‬

Gamification
“And wouldn’t it be
 easier to innovate if
 life were more like a
 game.”
- Dan Newman, public
  strategist
‫+‬          ‫=‬
‫قواعد هنطقية‬       ‫رسوم‬
                              ‫ألعاب‬
ً‫تقنيا‬



Real-time Software
Game Loop
// a simple game loop in C++
int main()
   {
        Initialize();
        while (true)
        {
                 Update();
                 Render();
        }
        ShutDown();
   }
Real-time Loops




                                                               Single-Threaded Fully
    Coupled Approach           Twin-Threaded Approach
                                                                     Decoupled


Source : Core Techniques and Algorithms in Game Programming
                             By Daniel Sánchez-Crespo Dalmau
‫انتاج الرسوم‬
‫انتاج الووسيقى والوؤثرات الصوتية‬
Component-Based Architecture




          !‫هكونات؟‬
OPP
                                     Entity


     Entity
                           Movable            Static

Movable    Static
                               Player             Door

  Player      Door
                              Enemy
  Enemy
                           DynamicDoor
Component-Based Architecture
                                    Player
            Component               • Transform
                                    • Renderer
Transform   Renderer    Mover       • PMover

                                    Enemy
                         PMover
                                    • Transform
                                    • Renderer
                         AIMover    • AIMover

                                    Door
                        DoorMover
                                    • Transform
                                    • Renderer
                                    • DoorMover
‫أفكار لتطبيقها؟!‬
Class Entity
{
     Movable moveSystem;
     boolean canMove;

     public Entity(boolean canMove, Movable moveSystem){
       this.canMove = canMove;
       this.MoveSystem = MoveSystem;
     }
     public Movable getMoveSystem()
     {
       if(canMove)
       return MoveSystem;
         else throw some exception...
     }
..
}
‫إدارة الوكونات‬
public boolean hasComponent(Class<C> klass)
{
  return component_table.Contains( klass );
}
public C getComponent(Class<C> klass)
{
  final C component = component_table.get( klass );
    if ( component != null ) {
       return component;
    } else {
       return null;
    }
}
‫تطبيق على ‪Unity‬‬

ميهين