Sound Basics

By , March 26, 2013 2:23 am

1. Find a sound, mp3s work best.
Effects:http://www.flashkit.com/soundfx/
Loops:http://www.flashkit.com/loops/

2. Import the sound into Flash.

3. Add AS3 Linkage to the sound in the library

4. Instantiate and play the sound with code:

//instantiate an instance of the Drum1Sound sound
var sound:Sound = new Drum1Sound();
//play the sound
sound.play();

5. Review class files from section 1.

6. Complete assignment 10. (1 week assignment)

23 Hours of Art (25pts extra credit for Game Tech I students who present)

By , March 14, 2013 2:51 pm

This coming weekend, the Creative Media BFA program will be sponsoring an event called “23 Hours of Art.” The idea is to stage an art marathon over 23 hours in Hauke Lounge from Fri. March 15 at 6PM through Sat. March 16 at 5PM. The key question is: what is art? or perhaps, “what can art BE?”

Our goal is for 101 different works of art to be presented over the 23 hour period. “Art” means any and all genres, any and all media. Each presentation is roughly 10 minutes in length (we can be flexible).

I know everyone is busy and that the weekend is not the best time to ask for your presence, but please consider taking 10 minutes to present–and perhaps another 30 or 40 minutes to hang out and see what other people are saying.

Two ground rules:
1. The art work presented cannot be one’s own. So you could present a poem by Yeats, a snippet of a Hitchcock film, an image from Georgia O’Keefe, a monologue that your roomate wrote, a sculpture you bought at a yard sale, or even a really beautiful wine bottle. But it’s not your own–no need to defend or to prove anything.
2. There is no discussion or debate during the ten minutes. The presenter presents the work and says why it’s art or what s/he likes about it or feels about it or . . . . The audience listens and accepts. We’ve built in discussion/debate time throughout the event, typically during each hour.

Email ronis@champlain.edu with a preferred day/time to present.

Current Schedule
Friday March 15

6PM–Bob Selby
6:10–Taylor Silvestri
6:20–Ken Howell
6:30–Zoe Barracano
6:40–Maya Barracano
6:50–Scott Barrett

7PM check in and discussion

7:10–Justine Gerns
7:20–Suzanne Glover
7:30–Gordon Glover
7:40–Chris Thompson
7:50–Zack Wincklhofer
8PM–Rebecca Schwarz
8:10–Pablo Valentin
8:20–Julian Banks
8:30–Eric Ronis

8:40 check in and discussion

8:50–Erin Barnaby
9PM–Jean-Luc Seipke
9:10–Judd Mitchell
9:20–Tom Barlow
9:30–Robin Perlah
9:40 ****
9:50–Al Larsen

CREM at 10 (discussing the interdisciplinary BFA program and answering questions) plus discussion, “What is Art?”

10:30 ***
10:40 ***
10:50 ***
11PM–Rob Barracano
11:10–Eric Ronis
11:20 ***
11:30–Alexandria Allen
11:40 ***

11:50 Check in and Discussion/set up

Saturday, March 16

Midnight Musical Mayhem (Dancing!)–featuring the Stoop Kids

12:30–Jonathan Balling
12:40–Kendre Guinane
12:50–Meghan Willis
1AM– ***

1:15AM discussion and PIZZA

1:45AM–Sean Heasley
1:55AM–Eric Ronis

2:10–The Late, Late Show (featuring one of the best X Files episodes), popcorn and beverages served

3AM–LATE DEBATE, What is Art?

3:30–Lindsay Farr
3:40–Meg Diestche
3:50–Zach Grassette

Fun times at 4! (Improv Comedy)–yes, Los Dormant Volcanos will perform at 4AM

4:30AM–Dave Bender
4:40–Megan Lambros
4:50–Will Saxe
5 AM–Chris Williams
5:10–Lindsay Farr
5:20–Donny Torrey
5:30–CJ Lack
5:40–CJ Lack

Silence at six–Meditiation

6:15 to 7AM–nap break: dreaming of art

7AM–Discussion over Donuts and Coffee

7:20 ***
7:30 ***
7:40 ***
7:50 ***

8AM–Yoga Time with Kathy Leo-Nyquist

8:30AM–Kathy Leo-Nyquist
8:40–Eric Ronis
8:50 ***
9AM ***
9:10 ***
9:20–Matt Harrison
9:30–Cinse Bonino
9:40–Signe Daly

CREM at 10 (discussing the interdisciplinary BFA program and answering questions) plus discussion, “What is Art?”

10:30AM–Eric Ronis
10:40 ***
10:50–Leila Smith

Slammin’ at Eleven (poetry performance)

11:30AM–Maggie Hunter
11:40–Chad Shaw
11:50–Rowshan Nemazee

Noon–lunch break

12:30PM–Marc Nadel
12:40–Rich Monroe
12:50–Parker Boeing
1PM–Eric Ronis
1:10 ***
1:20–Frist Wiggins
1:30 ***

1:45–Final discussion: What is Art?

2PM–END

Joe’s Graphic Game (working on it)

By , February 19, 2013 10:41 pm

Since all 3 sections of Game Tech I are working on their Graphic API assignment, I decided to create a version of my own. All assets for this assignment need to be created with the graphics API in AS3. I will try to finish it this week.

Controls: Arrow Keys to move target, and Z, X, C to shoot Laser.

 

Shooting with Timer Delay (updated w/ pause)

By , February 14, 2013 11:17 am




Here’s the source code: multiFireWithDelay.zip
Here’s an example that has lots of good stuff happening that you might be able to apply to your vertical shooter.

Constraint based design

By , February 24, 2012 10:54 am

Designers in Production I, please read. The first constraint should seem very familiar.
http://www.gamasutra.com/view/news/129770/Opinion_Constraintbased_design.php

Snake Game

By , October 17, 2011 1:28 am




Here’s the source code: SnakeGame.zip
It currently has 22 parts, wow. Just uncomment the sample you what to test. At some point I would like to add some new features to make this game unique.

Spawn and remove objects/enemies (AS3 for Flash, Lua for Corona, Javascript for Unity)

By , October 10, 2011 3:21 am

This is the first post in a series of new samples  that will show similar code translated into multiple engines, typically Flash(as3), Corona(Lua) and Unity(javascript), maybe even UDK too. This first example just spawns 10 squares(enemies) on the screen. If you click one, the square disappears. If you click the background, they all disappear. If you click the background when there are no squares, the squares will respawn.

Flash-AS3Flash source files

//create a table(array) to store the enemies
var enemyTable:Array = [];

//this function gets passed an enemy to remove
function removeEnemy(enemy){
	//loop through the table
	for( var i=0; i< enemyTable.length; i++ ){
		//find the item in the table that is the same as the enemy
		if(enemyTable[i] == enemy){
			//remove the enemy from the table
			enemyTable.splice(i,1);
			//remove the enemy
			removeChild(enemy);
			//break out of the loop
			break;
		}
	}
}

//listener that gets attached to each enemy
function touchListener(event:MouseEvent){
	//
	//
	//find out which enemy we are talking about
	var enemy = event.currentTarget;
	//need to remove event listener, it's  not automatically removed
	enemy.removeEventListener( MouseEvent.CLICK, touchListener);
	removeEnemy(enemy);
	//
	//
	//
}

//spawnEnemies function
function spawnEnemies(){
	//loop 10 times
	for(var count:int = 0; count<10; count++){
		//draw 10 rectangles at random locations
		var enemy = new Sprite();
		enemy.graphics.beginFill(0x8C8C8C);
		enemy.graphics.lineStyle(3, 0xB4B4B4);
		enemy.graphics.drawRect(0, 0, 50, 50);
		enemy.x = Math.random()*stage.stageWidth;
		enemy.y = Math.random()*stage.stageHeight;
		addChild(enemy);
		//add a touch event to each enemy
		enemy.addEventListener( MouseEvent.CLICK, touchListener )
		//add the enemy to the enemyTable
		enemyTable.push(enemy);
	}
}

//function called when you click the green bg
function removeAll( event:MouseEvent ){
	//
	//
	//if all the enemies are gone, respawn them
	if(enemyTable.length == 0){
		spawnEnemies();
	}else{
		//loop through the table
		for(var i:int=0;i<enemyTable.length; i++){
			//remove each enemy
			removeChild(enemyTable[i]);
		}
		//set the enemyTable to empty
		enemyTable = [];
	}
	//
}

//draw the bg
var bg:Sprite = new Sprite();
bg.graphics.beginFill(0x99ff00);
bg.graphics.drawRect(0,0,stage.stageWidth, stage.stageHeight);
addChild(bg);
bg.addEventListener( MouseEvent.CLICK, removeAll )
//spawn the enmies
spawnEnemies();

Corona-LuaCorona source files

--create a table(array) to store the enemies
local enemyTable = {};

--this function gets passed an enemy to remove
local function removeEnemy(enemy)
	--loop through the table
	for i=1,#enemyTable do
			--find the item in the table that is the same as the enemy
			if(enemyTable[i] == enemy) then
				--remove the enemy from the table
				table.remove (enemyTable,i )
				--remove the enemy
				enemy:removeSelf();
				--break out of the loop
				break;
			end
	end
end

--listener that gets attached to each enemy
local function touchListener( event  )
	--only do remove the enemy when the touch begins
	if(event.phase=="began") then
		--find out which enemy we are talking about
		local enemy = event.target;
			--don't need to remove event listener, it's automatically removed when you remove the object
			--enemy:removeEventListener( "touch", touchListener );
			removeEnemy(enemy);
			--by returning true it prevents the touch event from continuing to the bg
			 return true
	end
end

--spawnEnemies function
local function spawnEnemies()
	--loop 10 times
	for count = 1,10 do
		--draw 10 rectangles at random locations
		local enemy = display.newRect(math.random(display.contentWidth), math.random(display.contentHeight), 50, 50)
		enemy.strokeWidth = 3;
		enemy:setFillColor(140, 140, 140);
		enemy:setStrokeColor(180, 180, 180);
		--add a touch event to each enemy
		enemy:addEventListener( "touch", touchListener )
		--add the enemy to the enemyTable
		enemyTable[count] = enemy;
	end
end

--function called when you click the green bg
local function removeAll( event )
	--only remove all when the touch first starts
	if(event.phase=="began") then
		--if all the enemies are gone, respawn them
		if(#enemyTable == 0) then
			spawnEnemies();
		else
			--loop through the table
			for i=1,#enemyTable do
				--remove each enemy
				enemyTable[i]:removeSelf();
			end
			--set the enemyTable to empty
			enemyTable = {};
		end
	end
end

--draw the bg
local bg = display.newRect(0,0,display.contentWidth, display.contentHeight)
bg:setFillColor(153, 255, 0)
bg:addEventListener( "touch", removeAll )
--spawn the enmies
spawnEnemies();

Unity-JavascriptUnity source files

//create a table(array) to store the enemies
var enemyTable:Array = [];
var enemyPreFab:GameObject;

//this function gets passed an enemy to remove
function removeEnemy(enemy){
	print("removeEnemy()");
	print(enemy);
	//loop through the table
	for( var i=0; i< enemyTable.length; i++ ){
		//find the item in the table that is the same as the enemy
		if(enemyTable[i] == enemy){
			//remove the enemy from the table
			enemyTable.splice(i,1);
			//remove the enemy
			Destroy(enemy);
			//break out of the loop
			break;
		}
	}
}

//spawnEnemies function
function spawnEnemies(){
	//loop 10 times
	for(var count:int = 0; count<10; count++){
		//draw 10 rectangles at random locations
		var position:Vector3 = Vector3(Random.Range(0, 16), Random.Range(0, 10), 0);
		var enemy = Instantiate(enemyPreFab, position, Quaternion());
		//add the enemy to the enemyTable
		enemyTable.push(enemy);
	}

}

//function called when you click the green bg
function removeAll(){
	//
	//
	//if all the enemies are gone, respawn them
	if(enemyTable.length == 0){
		spawnEnemies();
	}else{
		//loop through the table
		for(var i:int=0;i<enemyTable.length; i++){
			//remove each enemy
			Destroy(enemyTable[i]);
		}
		//set the enemyTable to empty
		enemyTable = [];
	}
	//
}

function Start(){
	//spawn the enmies
	spawnEnemies();
}
function Update () {
	if(Input.GetMouseButtonUp(0)){
		var ray = Camera.main.ScreenPointToRay (Input.mousePosition);
		var hit:RaycastHit;
		if (Physics.Raycast (ray, hit,100)) {
		    removeEnemy(hit.transform.gameObject);
		}else{
			removeAll();

		}
	}
}

Unity and Flash : a sneak peek.

By , September 5, 2011 10:25 pm


http://blogs.unity3d.com/2011/09/01/unity-and-flash-a-sneak-peek/

Link to maze

By , June 29, 2011 11:12 am

http://blog.flashvt.com/wp-content/uploads/2011/06/givMaze.zip

Air 2.7 SDK download Available; Works with Flash CS5.5

By , June 14, 2011 9:16 pm

http://blogs.adobe.com/flashplayer/2011/06/adobe-air-2-7-now-available-ios-apps-4x-faster.html

Performance boost for iOS rendering with CPU is huge. I am still trying to figure out when it is best to use CPU rendering compared to GPU rendering. I just published an app that is predominantly a scrolling list with some images and with Air2.6, I had to use GPU rendering, CPU rendering would just crawl.

Republishing in Flash CS5.5 with Air2.7 and CPU rendering and the scrolling list flies on my iPhone 3gs.

So you basically have two options if you want to start packaging your apps with Air2.7. You can use ADT that comes with the Air2.7 SDK or if you have CS5.5, you can just replace the AIR2.6 folder contents with the Air2.7 SDK.

Regardless, you first need to download the Air2.7 SDK:
http://www.adobe.com/products/air/sdk/

If you have Flash CS5.5, you can replace the files in C:\Program Files (x86)\Adobe\Adobe Flash CS5.5\AIR2.6 with the Air2.7. Just to be safe, I renamed Air2.6 to Air2.6bu and renamed the Air2,7 to Air2.6. It worked!

If you are still CS5, you can follow the exact same directions that are in my tutorial below, just when you are Setting up ADT, make sure you point the path to the new Air2.7 sdk folder.