Sunday, June 5, 2011

final game - .fla file



https://sites.google.com/site/deeemef203/fla-file

final game - .as file



https://sites.google.com/site/deeemef203/as-files

final game - .swf file



https://sites.google.com/site/deeemef203/swf-files

Sunday, May 15, 2011

initial final game proposal for DMF 203

DMF 203 game – final Project
Goals: This game will be a ‘first-person shooter’, of sorts. I’m behind on the lingo. Would the original ‘Asteroids’ be considered an ‘FPS’?. The terrean spaceship (in geosynchronous orbit), will be making shoot/don’t shoot decisions (no logic to these, by the way) and based upon the target hit, will score points, or have points deducted. Is that bifurcated object that is headed your way a Ctulhuian nursing bottle (they are important allies) - for their giant two-mouthed infants (which morph into 3 mouths after they lose their set of ‘eye teeth’) - or is it a miniaturized Maladrxirian binary fission weapon? Is that a Zoooooooooooooooooooordn ‘man-of-war’ craft, or a Shiiiishnian geriatric tour spacebus, coming to see the Grand Canyon and donate their earthling-compatible extra organs, which used to go into landfills on their home planet? Think fast! Or, “Feel the force”, or, “I haven’t even had my morning coffee yet; why do they have me manning the plasma cannon on this rust-bucket when I haven’t had the minimum required refresher simulation training in over ten months?”

The ‘bogies’ will be starting at the top of the screen, and descending towards the bottom of the screen, where the patrol ship moves from left-to-right horizontally, based on mouse movement. Clicking the mouse shoots projectiles, which travel in a straight line, after they are fired. This is not intended to be a friendly/logical/satisfying game. Think ‘Sartre Pac-man’. Or Buddha, for that matter (Life is suffering…). This game is more about mordant humor, modern angst, cynicism, and betrayal-of-trust issues, than it is about ‘fair play’ and richly-rewarded motor skills.

Things to think about and attempt to program in:
1) A ‘space background’ with stars, that moves somehow, but is easily visually distinguishable from the incoming objects.
2) Sound effects. Some background noises (for the sheer annoyance/distraction), and sounds for ‘collisions’ (and launching ‘projectiles’?).
3) Some way of displaying scores (and irreverent messages)
4) ‘Random generators’ for different objects, and random vectors, and random speeds?
Random generators for score deductions (That hostile just moved past you at mach 27. Text display – “Why didn’t you have your transonic monitors turned on?”).

Title: Galactic Xenophobia II

Much coding to learn…

Sunday, May 8, 2011

1st game e-mailed to Adam; here is 'funkyActionScript' coding

Here is the coding for game1, if anyone cares to take a look at it. This game does have 'issues'.

//EMDA 203 "First Game" base code v.1
//v1: now with Mouse Control! //Sound! hitTestObject! StageBoundaryBounces!

package
{
//import flash.display.DisplayObject;
//I couldn't figure out the visibility stuff...
import flash.display.MovieClip;
import flash.events.Event;
import flash.ui.Mouse;
import flash.events.MouseEvent;
import flash.display.DisplayObjectContainer;
//
//import flash.media.Sound;//

public class FirstGame1v2 extends MovieClip
{
//Declare Global Variables
var player:MovieClip;
var ball:MovieClip;
var ball2:MovieClip;
var projectile:MovieClip;
var projectile2:MovieClip;
var vx:Number;
var vy:Number;
//var ballBounceSound:Sound;//***NEW
//var playerSound:Sound;//***NEW
var score:Number; //The score

public function FirstGame1v2()//CONSTRUCTOR FUNCTION
{
//Instantiate Variables
trace ("top of constructor")
player = new SmallVertRayGun;
ball = new SmallSaucerGuy;
ball2 = new Alien;
projectile = new SmallRay;
projectile2 = new SmallRay;
vx = 15; //setting movement rates; see much farther down
vy = 2; //setting movement rates; see much farther down

//ballBounceSound = new SoundBasso;//***NEW
//playerSound = new SoundGlass;//***NEW

trace ("Welcome to Galactic Xenophobia!");
score = 0; //This starts the game at 0
trace ("the score is " + score);

//Hide the mouse ***NEW
Mouse.hide();

//Set up the stage
addChild(player);
addChild(ball);
addChild(ball2);
addChild(projectile);
addChild(projectile2);


player.x = stage.stageWidth*.5; //positioning raygun
player.y = stage.stageHeight*.93; //positioning raygun
ball.x = stage.stageWidth*.5;
//positioning SaucerGuy, when he makes his(?) entry
ball.y = stage.stageHeight*.05;
//positioning SaucerGuy, when he makes his(?) entry
ball2.x = stage.stageWidth*.5;
//positioning Alien, when he makes his(?) entry
ball2.y = stage.stageHeight*(.001);
//positioning Alien, when he makes his(?) entry



// Event Listeners
addEventListener(Event.ENTER_FRAME, onEnterFrame);
stage.addEventListener(MouseEvent.CLICK, myClick);
//looking for mouseClick, to do something with

}

// Event Handlers

function myClick (event:MouseEvent):void
//this is for firing ray with mouseClick
{

trace ("mouse click detected");
//had problems; testing function

addChild(projectile2); //moving 'ray';
projectile2.x = (player.x - 10);
projectile2.y = stage.stageHeight*.87;
//these last 2 lines superimpose it on original 'ray'


if (projectile2.y == projectile.y)
{

removeChild(projectile);
}

trace
("Do you truly feel comfortable trying to destroy ");
//testing things
trace ("something/someone you have never even tried to talk to?");

if ((projectile2.y < projectile.y) || (projectile2.y == 0)) { //trace ("Hunh?"); //testing things removeChild(projectile); } if (projectile2.y < 0) { addChild(projectile); } } function onEnterFrame(event:Event):void { // PLAYER X CONTROLLED BY MOUSE ***NEW player.x = mouseX; projectile.x = (player.x - 10); projectile.y = stage.stageHeight*.87; //Stage Boundary Collisions if(ball.x > stage.stageWidth || ball.x < 0) { vx = -vx; //ballBounceSound.play();//***NEW } if(ball.y < 0) { vy = -vy; } //check for Saucer/RayGun collisions if(player.hitTestObject(ball)) { removeChild(ball); addChild(ball); ball.x = stage.stageWidth*.5; ball.y = stage.stageHeight*.05; //playerSound.play();//***NEW addScore(-2); //penalty for saucer crashing into your gun emplacement } //check for Projectile/Saucer collisions if(projectile2.hitTestObject(ball)) { removeChild(projectile2); removeChild(ball); addChild(ball); ball.x = stage.stageWidth*.5; ball.y = stage.stageHeight*.05; //playerSound.play();//***NEW addScore(2); } //check for 'friendly fire' collateral damage if(projectile2.hitTestObject(ball2)) { removeChild(projectile2); removeChild(ball2); trace ("What are you doing! That organism was on our side!") //playerSound.play();//***NEW addScore(-8); } //allows SmallSaucerGuy to advance down past SmallRayGun, and move off stage // and then brings in new SmallSaucerGuy if(ball.y > stage.stageHeight*.99)
{

addChild(ball);
ball.x = stage.stageWidth*.5;
ball.y = stage.stageHeight*.05;
//ballBounceSound.play();//***NEW
addScore(-2); // you snooze, you lose

}





//move stuff
ball.x += vx;
ball.y += vy;
ball2.y += 2*vy;

projectile2.y += 4*(-vy); //speed of 'ray' (projectile2)



}// end onEnterFrame function


function addScore(addThis:Number):void
//adds or subtracts certain amount to score
{
score += addThis; //computes the score
trace ("your score is " + score); //displays the score

if (score > 2)
{
vx = 30;
//increases the side-to-side speed of the saucer
}


if (score > 8)
{
trace ("Your score may be 10, but Pride goeth before the fall...");
vx = 45; //increases the side-to-side speed of the saucer
vy = 5;
//increases the speed of the saucer's vertical approach to your position
}

if (score > 10)
{
//this makes the saucerGuy very small
ball.width = ball.width*.15;
ball.height = ball.height*.15;
}

if (score > 12)
{
//now you lose your rayGuy completely
removeChild(player);
}

if (score < 12)
{
addChild(player);
}

if (score < 10)
{
ball.width = ball.width*1;
ball.height = ball.height*1;
}

if (score < -12)
{
trace ("Your defensive efforts have been sorely inadequate.");
trace ("If you have actually survived this possibly hostile ");
trace ("extraterrestrial border incursion, consider yourself");
trace ("posted to kitchen duty until the time and date of your ");
trace ("court-martial has been scheduled.");
}

}


}// end class
} // end package

Saturday, April 23, 2011

flash movie info

As per Adam's instructions, I have already e-mailed him with my Flash animation as an attachment. We tried to figure out how to post it here on lab on Tuesday, and couldn't get it to work.

Friday, April 22, 2011

reflective essay #4

Years ago, when I was a much younger man, I studied TaeKwondo, in Eugene. I attended a dojang for several years, and, later, partly due to time and money constraints while a student, I dropped out of the dojang, but ended up joining a University of Oregon TaeKwonDo club started by a Korean student. Most of the time we practiced in a gym in Gerlinger Hall. Gerlinger Hall (if it’s still standing) is a turn-of-the-century building built partly of bricks, but a lot of its construction is also wood. A lot of martial arts practice is comprised of repetitive drills, to create ‘muscle memory’ so that you can do techniques without having to think about them much if you need to react quickly. In the styles I have been exposed to, these drills tend to be fairly formalized, and their relevance is not always immediately apparent to the beginner, but they help to develop the skills to lead up to actual controlled sparring. Repetitive drills can also be surprisingly meditative, as long as they don’t hurt too much. I tended to have a harder time relaxing and enjoying myself when punching an old-style ‘makiwara’ (rope-wrapped punching post). Anyway, one of my most pleasant, sensual memories is of doing drills, moving across the wooden floor, in Gerlinger Hall. My favorite form of this drill was, in response to a ‘numbers’ command, moving first forward across the floor, and then backwards, from ‘front stance’ to front stance, changing the lead foot, and doing a strong-side ‘reverse-punch’ into the air at the end of the movement, while executing a ‘kiai’ (shout). This may sound strange, but being young and fit, and moving in unison with rows of others, concentrating on keeping the knees bent and hips low while moving, finally ‘hitting the mark’ in unison with everyone else, while trying to keep the punch relaxed-but-fast-and-strong-at-the-last-moment, with everything coming together at the end, was extremely enjoyable. There were a couple of things that really makes this memory endure for me. The first was the feel of the floor. Two dozen bodies or so moving in unison, and planting 75% of their weight on their front feet at the same time (feeling the soles of your bare feet, and toes, against the polished wood), made that floor ‘give’ in a way that felt incredibly interactive. The floor was working out with us. The second really good part of the experience was the massed ‘kiai’. I have always enjoyed the sensation of power that shouting out a good kiai gives, and when everyone shouted at the same time in that large wooden room, the sound seemed to just swirl around for a moment or two before bouncing back to us in an echo.
Years ago, I used to play a little pinball. I was never any good at it, but it was fun. Finding a good pinball arcade, and walking into it, was magical. There was the anticipation of walking in and past all the machines, and the people playing them, and trying to find a machine that was available, and that you were willing to dump a ridiculous amount of quarters into. There was dinging going off everywhere. Just listening to it created an anticipatory pleasure. There was the settling in on the machine, then putting a few quarters on the glass top, then getting into a good strong stance (similar to the front stance). I usually had my left foot forward, and the right leg back. Putting in the first quarter, and hearing the start-up sounds. I always tested the flippers first, before I launched the first ball. Like I say, I really wasn’t very good at it, but I would snap my middle fingers against the flipper buttons so convulsively, that the next morning it frequently felt like I had bilateral tendonitis. I wasn’t very good at relaxing while playing pinball. I didn’t get very excited by the bumpers, but flashing colored lights were good, and all of the sounds, and I loved gates that spun around a lot when I hit them fast. Some machines were better than others when it came to giving you the opportunity to ‘trap’ the ball at the base of the paddle, and take a moment to collect your thoughts, and let it roll slowly down the paddle, towards the tip of the paddle. Those were the only games I had any chance of winning. I think it was ‘Space Station’ that I did the best on. ‘Space Station’ did not have nearly as much stuff going on in terms of bells and whistles, but it had some, and it was visually clearer. I didn’t like the ‘golf holes’ that ended up shooting the ball back at you so fast, that it was very easy to miss. I also tended to panic and swear loudly when playing games that released 3 balls at the same time. Responsibly mentoring one ball was a heavy burden; 3 balls was too much responsibility. A golden pinball memory: The ‘Captain Fantastic’ in a tavern in Berne, Switzerland in October of 1976 that gave me free replays no matter what I did! Manna from heaven! (Oh my god, I’ve been here for 3 hours and I really need to use the restroom, but this opportunity may never come in my life again…Could I get deported if I get caught not reporting this?).
I went through a period of baking bread, several years ago. The footwork of kneading dough, for me, was similar to pinball. It was necessary in kneading to be able to rock back and forth, using your body weight to compress the dough. While slighty shifting back, one slightly rotates the dough counterclockwise, then repeats the cycle. Its very primal, and you feel that dough moving underneath your hands, and it starts out soft, and sticky, and as you gradually sprinkle more and more flour onto it, it gets to the point where you no longer are acquiring a film of dough on your palms. By this time, the dough is getting firmer and more elastic, and is starting to ‘push back’. It’s very repetitive, and also somewhat meditative. You let the dough rise, and then you get to dump it out, punch it down, and knead it again. When you pull it out of the oven, and you see how much it has grown, and the ‘brownness’ of the top, and you smell that incredible smell, you know you have accomplished something.
As regards some of the reflective essay questions; doing a martial art, for me, is almost entirely a ‘conscious’ experience. Pinball is definitely a mix. There is a certain amount of physicality and focus, but one is taking in a lot of the sounds without really paying conscious attention to it (at least for me). Breadmaking is also both. Kneading is very conscious, but the smells, I would say unconscious. I’m not sure how I would relate this to playing a game. I would think that sounds especially, would be a way to complicate the players performance. The introduction of unexpected sirens and flashing lights are a good way to distract the player ("Why is that happening? What did I do?"). Also, a dull, throbbing, droning noise, could be subtly speeded up to stimulate heartbeat (I’m sure this works), with a sudden volume increase at an unexpected point.