Space Zombies (Final Project)

Here it is:
http://sainezart.blogspot.com/2011/03/art-351-final-project-game.html package

Programmer: Me
Graphics: Sam Soto
Animator:Frankie Rodrigues

Here is the tutorial that helped us get this working:
http://asgamer.com/2009/as3-flash-games-for-beginners-registering-hit-tests

Here is our code for rotating our guy:

stage.addEventListener(Event.ENTER_FRAME, rotateSonso); //my event listener

private function rotateSonso(Event):void //here is my function
{
xd = (stage.mouseX-this.x); /*leave this(suggested)*/
yd = (stage.mouseY-this.y); /*leave this(suggested)*/
// finds the x and y difference of the sprite and the mouse
radAngle = Math.atan2(yd, xd); /*leave this(suggested)*/
// finds the angle in radians (flash works in radians not degrees)
this.rotation = int(radAngle*360/(Math.PI*2)+90); /*leave this(suggested)*/
// uses PI because radians work with PI (not the tasty kind either)

}//close rotateSonso

To rotate your bullet with the character:

stageRef.addChild(new LaserGreen(stageRef, x, y, rotation)); //this is the code that adds the bullet this is located in my Sonso.as

In my LaserGreen.as:

package
{
import flash.display.MovieClip;
import flash.display.Stage;
import flash.events.Event;

public class LaserGreen extends MovieClip
{

private var stageRef:Stage;
private var bulletSpeed:Number = 16;
var shotSpeed:int = 16;

public function LaserGreen (stageRef:Stage, x:Number, y:Number, rotation:Number) : void
{
this.stageRef = stageRef;
this.x = x;
this.y = y;
this.rotation = rotation;

addEventListener(Event.ENTER_FRAME, loop, false, 0, true);
addEventListener(Event.ENTER_FRAME, moveShot);

}

private function loop(e:Event) : void
{
if (y 1200)
removeSelf();

for (var i:int = 0; i < Engine.enemyList.length; i++)
{
if (hitTestObject(Engine.enemyList[i].hit))
{
trace("hitEnemy");
Engine.enemyList[i].takeHit();
removeSelf();
}
}

}

private function removeSelf() : void
{
removeEventListener(Event.ENTER_FRAME, loop);

trace("remove");

if (stageRef.contains(this))
stageRef.removeChild(this);
}

function moveShot(event:Event)
{ /*leave this(suggested)*/
with (event.target)
{ /*leave this(suggested)*/

// with the object that called the event
this.x+= shotSpeed * Math.sin(rotation*(Math.PI/180)); /*leave this(suggested)*/
this.y-= shotSpeed * Math.cos(rotation*(Math.PI/180)); /*leave this(suggested)*/
// moves the shot depending on its rotation, uses build in math sin and cos functions
// remember that flash works in radians
}
}// close moveShot
}
}

To make sure when Mouse is held down the bullet keeps firing, you need to set an interval for each bullet that is being created:

Initialize:

private var bulletInterval = setInterval(createBullet, 150);
private var mouseIsDown:Boolean = false; //if mouse is down set to false

After that you gotta to get the event listener:

stage.addEventListener(MouseEvent.MOUSE_DOWN, mDown);
stage.addEventListener(MouseEvent.MOUSE_UP, mUp);

Here is the the function:

private function mDown(MouseEvent):void
{
mouseIsDown = true;
}//close mDown

private function mUp(MouseEvent):void
{
mouseIsDown = false;

}//close mUp

private function createBullet() : void
{
//if canFire is true, fire a bullet
//set canFire to false and start our timer
//else do nothing.

if (canFire && mouseIsDown)
{
stageRef.addChild(new LaserGreen(stageRef, x, y, rotation));
canFire = false;
soundChannel = laserSound.play(0);
fireTimer.start();
}

}


Flash Actionscript 3 Tutorial Links

Here is a great tutorial for making a simple Flash shooting game:
Create a shooting game using AS3:

Here is another great flash example for rotating an object with your mouse:
Rotate Object
You can download the source code here.

Here is my code for rotating my guy:

stage.addEventListener(Event.ENTER_FRAME, rotateSonso); //my event listener

private function rotateSonso(Event):void //here is my function
{
xd = (stage.mouseX-this.x); /*leave this(suggested)*/
yd = (stage.mouseY-this.y); /*leave this(suggested)*/
// finds the x and y difference of the sprite and the mouse
radAngle = Math.atan2(yd, xd); /*leave this(suggested)*/
// finds the angle in radians (flash works in radians not degrees)
this.rotation = int(radAngle*360/(Math.PI*2)+90); /*leave this(suggested)*/
// uses PI because radians work with PI (not the tasty kind either)

}//close rotateSonso

To rotate your bullet with the character:

stageRef.addChild(new LaserGreen(stageRef, x, y, rotation)); //this is the code that adds the bullet this is located in my Sonso.as

In my LaserGreen.as:

package
{
import flash.display.MovieClip;
import flash.display.Stage;
import flash.events.Event;

public class LaserGreen extends MovieClip
{

private var stageRef:Stage;
private var bulletSpeed:Number = 16;
var shotSpeed:int = 16;

public function LaserGreen (stageRef:Stage, x:Number, y:Number, rotation:Number) : void
{
this.stageRef = stageRef;
this.x = x;
this.y = y;
this.rotation = rotation;

addEventListener(Event.ENTER_FRAME, loop, false, 0, true);
addEventListener(Event.ENTER_FRAME, moveShot);

}

private function loop(e:Event) : void
{
if (y < 0 || x 1200 || x > 1200)
removeSelf();

for (var i:int = 0; i < Engine.enemyList.length; i++)
{
if (hitTestObject(Engine.enemyList[i].hit))
{
trace("hitEnemy");
Engine.enemyList[i].takeHit();
removeSelf();
}
}

}

private function removeSelf() : void
{
removeEventListener(Event.ENTER_FRAME, loop);

trace("remove");

if (stageRef.contains(this))
stageRef.removeChild(this);
}

function moveShot(event:Event)
{ /*leave this(suggested)*/
with (event.target)
{ /*leave this(suggested)*/

// with the object that called the event
this.x+= shotSpeed * Math.sin(rotation*(Math.PI/180)); /*leave this(suggested)*/
this.y-= shotSpeed * Math.cos(rotation*(Math.PI/180)); /*leave this(suggested)*/
// moves the shot depending on its rotation, uses build in math sin and cos functions
// remember that flash works in radians
}
}// close moveShot
}
}


Narrative Animation

Here are is narrative animation with actionscript, but unfortunately wordpress limits embedding flash files into their site. I have provided a link to it instead:

http://webpages.sou.edu/~cerdanc/narrative.swf package

Here is the code:
{
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.media.Sound; //sound
import flash.media.SoundChannel;//sound

public class Narrative extends MovieClip
{
var room:roomScene;
var hallway:hallwayScene;
var cantina:cantinaScene;
var researchInventory:researchInventoryScene;
var hq:hqScene;
var armory:armoryScene;

var player:musicPlayer;
var music:hopeSound; //mp3 sound file
var soundChannel:SoundChannel; //sound
var i:int=0; //integer “i”, default value is zero

public function Narrative()
{
room = new roomScene(); //adds scene1
hallway = new hallwayScene();
cantina = new cantinaScene();
researchInventory = new researchInventoryScene();
hq = new hqScene();
armory = new armoryScene();

player = new musicPlayer();
music = new hopeSound();//sound
soundChannel = new SoundChannel(); //sound

addChild (room);
addChild (player);

room.btnHallway.addEventListener(MouseEvent.CLICK, toHallwayScene);
hallway.btnRoom.addEventListener(MouseEvent.CLICK, toRoomScene);

hallway.btnCantina.addEventListener(MouseEvent.CLICK, toCantinaScene);
cantina.btnHallway.addEventListener(MouseEvent.CLICK, toHallwayScene);

hallway.btnHQ.addEventListener(MouseEvent.CLICK, toHQ);
hq.btnHallway.addEventListener(MouseEvent.CLICK, toHallwayScene);

hallway.btnResearchInventory.addEventListener(MouseEvent.CLICK, toResearchInventory);
researchInventory.btnHallway.addEventListener(MouseEvent.CLICK, toHallwayScene);

player.btnPlay.addEventListener(MouseEvent.CLICK, goMusic);
player.btnStop.addEventListener(MouseEvent.CLICK, stopMusic);

}
//event handlers

function toHallwayScene(event:MouseEvent):void
{
if (contains(room))
{ removeChild(room); addChild(hallway);addChild (player); }

if (contains(cantina))
{ removeChild(cantina); addChild(hallway); addChild (player);}

if (contains(researchInventory))
{ removeChild(researchInventory); addChild(hallway); addChild (player); }

if (contains(hq))
{ removeChild(hq); addChild(hallway); addChild (player); }

}

function toRoomScene(event:MouseEvent):void
{
removeChild(hallway);
addChild(room); addChild (player);

}

function toCantinaScene(event:MouseEvent):void
{
removeChild(hallway);
addChild(cantina); addChild (player);
}

function toHQ(event:MouseEvent):void
{
removeChild(hallway);
addChild(hq); addChild (player);
}

function toResearchInventory(event:MouseEvent):void
{
removeChild(hallway);
addChild(researchInventory); addChild (player);
}

//Music play

function goMusic(event:MouseEvent):void //start music
{

trace(“Play music.”);
soundChannel = music.play(0,int.MAX_VALUE);

}

function stopMusic(event:MouseEvent):void //stop music
{

trace(“Stop music.”);
soundChannel.stop();

}
}
}


Dingbat Buttons

Here are my animated button, but unfortunately wordpress limits embedding flash files into their site. I have provided a link to it instead:

http://webpages.sou.edu/~cerdanc/dingbatButtons.swf


Reflective Essay


I guess we can define a button much a like a switch. You turn the switch, something else happens. The light turns on, your television, our computer, your car. You press the button, an effect happens. Cause and effect. Our life becomes more interactive because of this.

The design of it plays an important role to its affect. The animation of a button gives more to the feel of the interactive-ness of the design. A plane ol’ button works fine, but animating and adding effects gives us more feel and fun.

Mmh…great buttons in history. One thing comes to mind was the issue of slavery. Before slavery came to an end, somebody had to think that there was something wrong with that picture. But not until a button was pressed, that put this into action. Someone flipped the switch and said, we can’t think like this. This has to end. I’m not sure if this is the kind of “great buttons in history” you are looking for but I think it fits.

I don’t know if I have any personal favorites, I haven’t really thought about it and right now nothing comes to mind.


Dingbat Animations

Here are my animations, but unfortunately wordpress limits embedding flash files into their site. I have provided a link to it instead:

http://webpages.sou.edu/~cerdanc/dingbatAnimation.swf


Reflective Essay


One interactive media experience I have is the first time I saw Avatar in 3D. Watching it in such a way, give you more focus and attention to the detail of what you are watching. The eye-popping aspect of it gives detail to the physicality and sensation of what the movie is trying to portray. The colors, textures and the atmosphere of the movie makes it seem like the planet Pandora is actually a real place.

Playing video games is definitely an interactive experience. Video games has a way of sucking you in for hours. This is because it has a great deal of interactivity. You can feel the emotion and atmosphere as if you are in the game controlling everything. Video games has it all, drama, physicality, sensation, atmosphere all that good stuff. That’s why everyone likes it.

Today, was my birthday and my friend Lonny took me to a bar to get a drink for the first time. I have never tasted beer before in my life so the experience was a first. Upon taking a drink the taste change my whole face appearance to this bitter look. The smell and taste of caused me to gag. I consider another one of those interactive media because interactive media is just that, letting people experience what you are trying to portray. You want the audience the feel the emotion you are feelings, you want to let them know its atmosphere, its taste and smell, so to speak.


Dingbat Collages






Reflective Essay


The process of creating these five collages was actually quite fun. Using the 4 themes that I picked in the previous projects, I’ve created 5 collages in each particular theme. Since all the dingbats I’ve created, drag and dropping, transforming and scaling each dingbats was easy. From drawing to drag and dropping made it more efficient for me and clicking on a symbol made it easier for me to edit a particular dingbat without disrupting the other symbols.

At first, I was gonna use the standard document size, but as I worked with my collages more, it simply would not workout. So I experimented around the sizes and came out with I have. I am happy with it. I particularly like my superhero collage. I think it turned out great surprisingly. I was having a hard time starting with that one. Making this collages definitely led me to some visualization. But most of the things that came out was just by playing around with the symbols and if it looked cool then I kept it :) For me though sometimes having to work with something more literal gives me more focus. But with more visual experimentation broadens my creativity which I need for sure.


30 Dingbat Drawings

dingbatDrawings

Reflective Essay

For this particular project I was having a hard time think of a theme to work with, but I remember being in my Intro to Graphics Design class where I did three montages. My themes were about passion, royalty and extraordinary. I liked how my montages came out so I decided to go back to those themes and work with them some more and see how it will work out. I already had those themes before drawing my dingbats, but I also had another theme in mind. So I added light[vs]dark theme. The contrast between dark and light is interesting. With all the themes I had, it helped tremendously with my drawings. I had something to focus on and not go in tangent. I want to incorporate all 4 themes into one big theme, though I don’t exactly know how I am going to do that.

Drawing in flash has its advantages. I particularly like when you draw a line it smooths it for you. Though sometime it comes out the way you didn’t expect the drawing to come out. But overall, I got the hang of it and was making progress. The paint bucket was also very helpful. With it, I didn’t have to color each drawing by hand. I’m sure some of this dingbats I drew I’ll be able to use in the new future.


Dingbat Images


[p]assion


This piece is about expressing the heart, showing what it is that burns within. It shows the passion, the desire and the attitude that is being shown in this montage. Music, faith, songs, and love; it all comes from this heart that burns. Beyond the images, it shows the attitude within the heart. It is the heart of worship. What is it that burns within you?



[r]oyalty


This piece shows, that in the middle of poverty, the rut, the slum of life, there is still this sense of royalty within each and everyone. This royalty mentality is not based on riches, or social status, but it is about knowing who you are. Who are you?


[e]xtraordinary


At some point in our childhood, we always wanted or acted like a superhero. This shows that within everyone is the desire to be extraordinary. We have a longing for greatness, to be recognized, to be something for someone else or society, to make a difference in the world, that we are created for something more. Let us go back to this child-like thought that we can be extraordinary, that we are created for greatness. Arise and shine!


light[vs]dark

Light is always superior to dark. Dark is always inferior to light. When light comes, it has no option but to leave. In a world full of darkness, a glimpsed of light is enough to fill it. Even in our inner most being, there is a battle of light and darkness, but darkness only goes when light arrives. Be filled with light and victory is yours.



Kuya?

If you are wondering what Kuya is all about, it means Big Brother in filipino.
I’m filipino and since I’m the oldest out of all my sibling in my family, they call me Kuya.

That’s just how us filipinos roll, we respect our elders ;)

So I decided, why not make it a nickname. So I did. I, first, added it on my facebook and everyone started calling my kuya.
The name got stuck to me and got the name [k]reative Media, k, from kuya. There ya go. If you guys ever wondered about it, now you know.

-[kuya]Christian


Hello Art[351]

This blog site is dedicated for any media related projects I am gonna be working on. For now it will be just a blog site for my Digital Interactive Studio class for turning in work. All my work, projects and articles about digital stuff is gonna be posted here. Enjoy :)