the level controls everything.
On start the level creates a player object, a layer object, and loads the level data. It keeps a reference around to all these objects. A frame counter starts and every frame, update() is called on everything but player. Every clock tick the level will check the level data for new events. Which as of now are the following types, create enemy, have enemy shoot, create hazard, move. The level also contains the layer. Whenever a new object is added, the level lets the layer know about it. The enemy bullets, enemies, and hazards ask the Level for the player's position.
collided?-collided from player to enemies, enemy bullets, and hazards
collided?-collided from player bullets to enemies
create playerBullet(pos) from player to playerBullet
create enemyBullet from enemy to enemyBullet
the layer needs a copy off all on screen sprites, it needs to be alerted when the objects are destroyed as well
Create interface, collision with player, getBoundingBox and collided methods
OK!!!!
Main Game Loop instantiated.
Main Game Loop instantiates Layer.
Main Game Loop instantiates Player.
Main Game Loop instantiates Level.
The layer also has a reference to everything.
Player needs to listen to control events.
Every clock tick Main Game Loop sends the time to the level and asks for two things.
Level has two different interfaces.
New enemies or hazards that return an object which then get passed to the layer.
Then an interface where a ID (or enemy object itself) is passed in to the level.
this will either pass back the next action or enact it on the enemy itself.
Main Game Loop can check for collisions.
Players and enemies need to create bullets that get added to layer and also need to make collision checks.
Main Game Loop
-- Keeps track of all onscreen object, also forwards them to layer
- Do everything BUT move player (because the TouchDelegate goes on the sprite)
- Check for shoot
- Player Shoot (returns player bullet object) - forwards to layer
- Level Update (follows different interfaces)
-- Checks for new creation, creates and returns for addition to main game loop and layer
-- Then passes in each enemy, it will check if there are any updated movement for that enemy and make that move
--- WHAT ABOUT SHOOTING AND CREATING NEW ENEMY BULLETS
OR
-- Could do everything and the function returns all newly instantiated objects.
- Check for collisions
Every clock tick.
Layer
Creates a new Level.
Level has two different types, creation events that create a new enemy or hazard, these happen no matter what.
Every tick, layer loops through enemies and hazards and passes the IDs to the level. the level will return any packaged commands for them to run.
没有合适的资源?快使用搜索试试~ 我知道了~
iOS游戏应用源代码——jodonnell-Touchaga-4aaa598.zip
共75个文件
m:28个
h:27个
png:9个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 75 浏览量
2023-07-05
23:16:25
上传
评论
收藏 252KB ZIP 举报
温馨提示
iOS游戏应用源代码——jodonnell-Touchaga-4aaa598.zip
资源推荐
资源详情
资源评论
收起资源包目录
iOS游戏应用源代码——jodonnell-Touchaga-4aaa598.zip (75个子文件)
jodonnell-Touchaga-4aaa598
main.m 357B
docs
requirements.org 8KB
todo.org 1KB
design
PlayerClass.graffle 235KB
bugs.org 82B
package_notes.txt 3KB
top_10_risks.txt 226B
development_process.org 1KB
stats.org 7KB
Resources
enemies.png 885B
touchaga.db 40KB
Icon.png 9KB
player.png 141B
background.png 27KB
warpCircle.png 2KB
bullet.png 225B
Default.png 30KB
Info.plist 774B
bullets.png 774B
fps_images.png 6KB
Classes
TouchagaAppDelegate.h 352B
SceneManager.h 431B
MainGame
Background.h 293B
SpriteManager.h 1KB
Globals.m 1KB
ShootButtonLayer.m 2KB
MainGameLoop.m 6KB
Globals.h 1KB
Player
WarpEnergy.h 1KB
PlayerInactiveLayer.m 991B
WarpOutCircle.h 2KB
PlayerInactiveLayer.h 780B
WarpEnergy.m 763B
WarpOutCircle.m 3KB
PlayerBullet.m 612B
PlayerBullet.h 360B
Player.m 4KB
Player.h 5KB
MainGameLoop.h 2KB
TouchagaSprite.h 895B
Background.m 523B
TouchagaSprite.m 989B
GameLayer.m 3KB
ShootButtonLayer.h 662B
SpriteManager.m 2KB
GameLayer.h 2KB
TouchagaAppDelegate.m 1KB
SceneManager.m 968B
Level
Path.m 2KB
SQLite3DataAccess.h 2KB
ScriptedObjectFactory.m 597B
Level.h 657B
LevelCreateEvent.h 694B
Path.h 1KB
LevelCreateEvent.m 489B
Level.m 866B
SQLite3DataAccess.m 7KB
Enemy.h 322B
ActionPoints
ActionPoint.m 945B
ActionPoint.h 890B
ShootSimpleBullet.m 613B
ActionPointSimpleParametizedFactory.m 733B
ShootSimpleBullet.h 513B
ActionPointSimpleParametizedFactory.h 348B
Pattern.h 1KB
Enemy.m 305B
ScriptedObjectFactory.h 729B
ScriptedObject.h 1KB
Pattern.m 1KB
ScriptedObject.m 1KB
BasicEnemy.m 737B
BasicEnemy.h 313B
.gitignore 106B
Tests
TouchagaTests.h 678B
TouchagaTests.m 2KB
共 75 条
- 1
资源评论
快乐无限出发
- 粉丝: 1133
- 资源: 7269
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- STC15单片机串口2使用程序例子
- 读取日志的excel生成周报 用python3开发weekplan-master.zip
- python 读取excel数据导入dbimport-data-master.zip
- K折交叉验证BP神经网络,多输入多输出BP神经网络(代码完整,数据齐全)
- B07训练原图.zip
- python-对Excel数据处理做可视化分析.zip
- 人工智能大作业-无人机图像目标检测的python源代码+文档说明.zip
- 基于GoogLeNet实现Cifar-10图像分类项目python源码(高分项目).zip
- 数据库 sql 面试题目及答案解析.docx
- 汽车常见 10 种传感器故障后的表现与解决措施.docx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功