Be a Supporter!

Question on creating Art Based game

  • 362 Views
  • 9 Replies
New Topic Respond to this Topic
M-Shack
M-Shack
  • Member since: Jun. 9, 2008
  • Offline.
Forum Stats
Member
Level 25
Blank Slate
Question on creating Art Based game 2010-05-15 17:15:19 Reply

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


BBS Signature
Halosheep
Halosheep
  • Member since: Apr. 9, 2009
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to Question on creating Art Based game 2010-05-15 19:35:29 Reply

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
Response to Question on creating Art Based game 2010-05-15 20:01:08 Reply

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
Response to Question on creating Art Based game 2010-05-15 22:06:23 Reply

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
Response to Question on creating Art Based game 2010-05-15 22:08:06 Reply

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
Response to Question on creating Art Based game 2010-05-16 18:24:41 Reply

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.?


BBS Signature
Version2
Version2
  • Member since: Sep. 24, 2003
  • Offline.
Forum Stats
Member
Level 14
Blank Slate
Response to Question on creating Art Based game 2010-05-16 19:02:01 Reply

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
Response to Question on creating Art Based game 2010-05-16 19:21:16 Reply

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.


BBS Signature
Neo-13
Neo-13
  • Member since: Jun. 9, 2007
  • Offline.
Forum Stats
Member
Level 23
Programmer
Response to Question on creating Art Based game 2010-05-16 19:46:46 Reply

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?


BBS Signature
Version2
Version2
  • Member since: Sep. 24, 2003
  • Offline.
Forum Stats
Member
Level 14
Blank Slate
Response to Question on creating Art Based game 2010-05-16 20:20:04 Reply

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.