Question on creating Art Based game
- M-Shack
-
M-Shack
- Member since: Jun. 9, 2008
- Offline.
-
- Forum Stats
- Member
- Level 25
- Blank Slate
Hi, I have been searching around for game creating in Actionscript and saw a few mentions of Art based games vs coding based games. I wanted to know if someone could explain this to me or point me in the right direction on where I can read up on or watch some tutorials about art based games. I have experience coding in AS2 making banners, web sites, etc. but none really in gaming and want to focus on my animation instead of trying to heavily learn AS3 or AS2 coding. I understand that art based means you make a lot of the assets manually instead of coding the movements and everything, but I wanted to get some more information on it before deciding if I wanted to pursue creating some games. And yes I know I need to start small and do some reading and tutorials on those basic games before trying to create something big. So any help would be greatly appreciated. Thanks
- Halosheep
-
Halosheep
- Member since: Apr. 9, 2009
- Offline.
-
- Forum Stats
- Member
- Level 05
- Blank Slate
I could be wrong, but I'm assuming that art based games are ones in which you draw the graphics in flash, and code based is where you create any graphics and effects using code.
"If everyone did things 75% right people would be ecstatic, so I demand that you change this C to an A+!" - Calvin and Hobbes
- Version2
-
Version2
- Member since: Sep. 24, 2003
- Offline.
-
- Forum Stats
- Member
- Level 14
- Blank Slate
I think you're trying to say Timeline based, or class based coding. You can put all your code in the timeline and mc's timelines, or you can use class files to control everything a lot easier (imo).
If you want to just concentrate on art, why not try teaming up with a programmer? I'm sure that would work out best if you don't want to concentrate on code.
- LeechmasterB
-
LeechmasterB
- Member since: Apr. 1, 2005
- Offline.
-
- Forum Stats
- Member
- Level 17
- Blank Slate
Artbased vs. Tilebased is a general discussion when talking about games. You can either create art based levels which have a single unique graphic or a few bigger graphical elements making up a level or you can create a level from tiles using a data array. Thats probably what you meant. Tilebased levels take up less file size but might look more boring then art based ones, while art based levels are usually bigger. Also tile based level will restrict your logic and design to a grid while art based won't.
There are plenty tutorials on tilebased games. Artbased games is just art and some coding to make collisions possible ect. But you can still use OOP and classes and clean coding for both type of engines.
- LeechmasterB
-
LeechmasterB
- Member since: Apr. 1, 2005
- Offline.
-
- Forum Stats
- Member
- Level 17
- Blank Slate
I forgot to mention 2 other pro's about tilebased games, collision with the map will use close to O(1) lookups instead of a lot of math and you can reuse graphical assets (the tiles) and create several levels using the same graphics (tileset).
- M-Shack
-
M-Shack
- Member since: Jun. 9, 2008
- Offline.
-
- Forum Stats
- Member
- Level 25
- Blank Slate
Alright, thanks for the info. So I guess I either need to team up with a programmer or just suck it up and learn some more action script. BTW, does AS3 offer more for games than AS2? I would prefer to try to stick with AS2 since I am already familiar with it and won't need to write out 3 lines of code to do a 1 line action. I know AS3 is more powerful and lets you use 3D and all that stuff, but would I be better off learning some game coding in AS2 or AS3 since I havn't really done any collisions, health bars, movement etc.?
- Version2
-
Version2
- Member since: Sep. 24, 2003
- Offline.
-
- Forum Stats
- Member
- Level 14
- Blank Slate
You might as well learn AS3 if you don't know a lot of AS2. When I made the switch I only had to relearn two things really, Events and event listeners, and that hitTest became hitTestObject/hitTestPoint.
What you're talking about, the 3 lines of code for a 1 line action, what you are most likely referring to are events. Pretty much instead of using just "on(ENTER_FRAME)" or however it's written in AS2, you would use 2 lines:
addEventListener(Event.ENTER_FRAME, update);
function update(e:Event):void{
}
But unlike AS2, you can also do custom events:
addEventListener("EnemyDeath", die);
if(health <=0){
dispatchEvent(New Event("EnemyDeath"));
}
function die(e:Event){
removeEnemy();
removeEventListener("EnemyDeath", die);
}
It's a few extra lines of code, but you can dispatch any kind of event yourself, even mouse clicks and key presses, at any time you want. This allows much more precise control of your game or program.
- M-Shack
-
M-Shack
- Member since: Jun. 9, 2008
- Offline.
-
- Forum Stats
- Member
- Level 25
- Blank Slate
Alright thanks. Yeah I already understand how things work, it's just a matter of coding it myself. Maybe i'll just edit some tutorials and what not till I learn.
- Neo-13
-
Neo-13
- Member since: Jun. 9, 2007
- Offline.
-
- Forum Stats
- Member
- Level 23
- Programmer
At 5/16/10 07:02 PM, Version2 wrote: But unlike AS2, you can also do custom events:
addEventListener("EnemyDeath", die);
if(health <=0){
dispatchEvent(New Event("EnemyDeath"));
}
function die(e:Event){
removeEnemy();
removeEventListener("EnemyDeath", die);
}
It's a few extra lines of code, but you can dispatch any kind of event yourself, even mouse clicks and key presses, at any time you want. This allows much more precise control of your game or program.
Is dispatching an event like that actually worth doing? Why not just call the function instead of going through the event listening part?
- Version2
-
Version2
- Member since: Sep. 24, 2003
- Offline.
-
- Forum Stats
- Member
- Level 14
- Blank Slate
It was a quick example. Usually you wouldn't do something like that in that same class. But, if I have, say, a class called EnemyHandler that creates instances of another class Enemy then pushes them into an array, I'll set up event dispatches in Enemy that tells EnemyHandler when to remove them from the array:
public class EnemyHandler extends MovieClip
{
private var enemyList:Array;
public function EnemyHandler():void {
enemyList = [];
for (var i:int = 0; i < 10; i++) {
var myEnemy:Enemy = new Enemy();
myEnemy.addEventListener("EnemyDead", die); //EnemyDead dispatches from Enemy class
addChild(myEnemy);
enemyList.push(myEnemy);
}
}
private function die(e:Event):void
{
enemyList.splice(enemyList.indexOf(e.currentTarget),1);
}
}
"currentTarget" is a really powerful tool when dealing with events.



