开发者

Putting two scripts together (actionscript)

I have two scripts I wish I could make a game with, but can't seem to make them work together. Both of them are working开发者_运维问答 great individually. I was hoping maybe someone could guide me into putting them together.

http://ifile.it/i6scean Here is the first.

http://ifile.it/h02wez5 This is the other. It's for the enemy to follow the player once he's in a particular range.

If that can help, the objective of the game is for the player to get to the opposite end of the "maze" without being hit by the enemy.

I also had trouble figuring out how to do the collision system, but I guess I could search this in the other questions.

Thanks a lot,

Mathieu


Just placing the second code below the first code (and renaming player_mc to player) works fine... Just make sure you also put the "enemy" movie clip in your library on your first project.... And get rid of the startDrag stopDrag code if you don't want the player to be able to click and drag the character.. For collision detection look into the "hitTest" function... Very simple stuff... put it in under the _root.onEnterFrame code so it's constantly being checked.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜