Another case, this time I’ve got to add some enemies to my game.
So! Just three cases to go until I have to have a game finished, I feel that I lack a lot of experience and understanding necessary for creating a final game with Flash and ActionScript 3. I’ve needed a lot of help from “the outside” in the previous cases, and this case was no different. I got a lot of help from my neighbour and from Learning ActionScript 3: The Beginner’s Guide. Mostly input on understanding why and how to use several classes, mostly for structure.
Case 7: Time to add some enemies (or friendly players) to your game. You basically have to understand the concept of using object oriented programming (OOP) and adding artificial intelligence (AI) to one objects or more in this case – to succeed with this case. You’ll be introduced to creating a new class that will communicate with your already created “main” class.
Reflections: I understand by now that I, should, devote even more time to understanding and learning the very fundamentals of programming in ActionScript 3.0. I need to devote time I feel I do not have at all, it is a struggle when I do not really aim to be a programmer – programming isn’t why I mainly chose this education. This mental lock I have in my head has made me quarrel and reflect a lot about programming, it’s not making it easier to understand and finish every case from week to week either.
If I have learned anything over the few past months in this course, it is that I am not really suited for programming, although I try my best I feel I can’t get further than what I’ve managed this far. I don’t want to give up just yet, but I’m not far away from doing so, I do at least want to finish my game – and to fulfill the idea and concept I have in my head. I guess the game idea I had in the start was too ambitious for me.
Difficulties: I had a lot of difficulties or problems I did not understand before starting this case. What I first did was chopping the problem into smaller pieces so it would be easier to work with. I had three questions I needed answers to
- What kind of code do I need to make a function randomly choose a number assigned to three different enemies? I want the game to have a different feeling to it each time a player starts the game.
- How can I add spawnpoints – where the player character walks past and an enemy “spawns”
coordinates to the right? I want the enemies to spawn when the player passes a certain object or point in my level. One spawnpoint should spawn only one enemy each. - How can I add artificial intelligence to the enemies? I want them to follow the player character along the x-coordinates.
Result: Here’s the visual result, and here is the code behind the enemies. I haven’t added the main-class, but it involves some changes related to the newly added class.
I’ll write some more words about the solution later.
No comments:
Post a Comment