Weitere ähnliche Inhalte Kürzlich hochgeladen (20) ميهين1. هيهين
http://a-saker.blogspot.com
http://e-saker.blogspot.com
3. الوحتوى
• مقدمة في تطوير األلعاب
• Component-Based Architecture
• تطبيق على Unity
5. صناعة األلعاب
Vs
$239 million $500 million
First Week Revenue First Week Revenue
Source : Video Game Industry Trends by Ferrarra
7. الوحتوي
التفاعلية
الفوز واخلسارة املشاركة القدرة على االختيار
10. “And wouldn’t it be
easier to innovate if
life were more like a
game.”
- Dan Newman, public
strategist
11. + =
قواعد هنطقية رسوم
ألعاب
13. Game Loop
// a simple game loop in C++
int main()
{
Initialize();
while (true)
{
Update();
Render();
}
ShutDown();
}
14. 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
19. OPP
Entity
Entity
Movable Static
Movable Static
Player Door
Player Door
Enemy
Enemy
DynamicDoor
20. Component-Based Architecture
Player
Component • Transform
• Renderer
Transform Renderer Mover • PMover
Enemy
PMover
• Transform
• Renderer
AIMover • AIMover
Door
DoorMover
• Transform
• Renderer
• DoorMover
22. 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...
}
..
}
23. إدارة الوكونات
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;
}
}