Showing posts with label Semester 3. Show all posts
Showing posts with label Semester 3. Show all posts

Wednesday, December 16, 2009

Flash Final Project


I think I finaly realized the importance of planning a video game. If you have a look at my final project for my multimedia class, it looks like I did not plan it at all. The graphics are horrible, and in one spot the text is not displaying properly. Yet the logic is pretty good.

It's a blackjack (this is my favourite one) game that I created from scratch. Everything had to be completely original. I chose to inlcude card counting just to give an extra element that could make it more interesting. The orginal idea was to have a dealer, two computer controlled players, and a human controlled player.

I had a card class, a deck class, a player class, a dealer class, and basic game play all worked. Except, by the time the asignment was due, I did not have any graphics working, and all the information needed was being traced to the output window in Flash. I given an extra week to finish it, by the end of that extra week, I did have any working graphics. Which leads me to my question. Is it better to start a Flash project by making sure the animations work properly, then tackle the logic, or vice versa?

I was not even able to get a card added to the stage. Never mind he simple animation of moving it across the table to appropriate place, then have it flip to reveal the face value. I was able to get one or the other but never both. There was the flip as a motion tween o the symbol' timeline. I had intended to add a card as needed, basing each card on one symbol from the library. Then adding the necessary info for each card. Or would it have been better to create 52 (or in the case my original idea - 208) symbol's in the library; one for each card.

In the end, as you can see, it was visually a disaster. However there was enough logic behind the scenes to get at least a passing mark assignment.



Powered by ScribeFire.

Friday, October 16, 2009

Flash - My First Experience

Adobe Flash Pro CS4 [Mac]

 I have discovered that I am not an artist, or designer in any kind of way.  I can not draw.  Take a look:



That is probably the best car I have drawn on a computer, and only the second best one ever.

My Mutimedia & Internet class is based on Flash and ActionScript.  After a an introduction into basic animations such as Classic, Shape, and Motion Tweens, we have moved onto ActionScript 3.0.

I find the Flash platform a crappy development environment.  I do not have much experience with animation, and  I am new to the Flash environment, but there is something unrefined about the user experience and the workflow.  The compiler and debugger seem as though they were added as an after thought.  It would be nice if there was a more unified approach to developing with ActionScript;  compiling should be a step by it self, where error messages are reported by themselves.  As it is, errors are being reported once Preview Movie is Selected.

Even the teacher says Flash CS4 is not the greatest tool available, and is looking for alternate methods for developing with ActionScript.  Since Flash is a very closed piece of software, I do not think he will be too successul.

On th upside, my ugly can turn, acclerate, and has an emergency break.  What I am looking to add is a way get the car bounce slightly off a wall (the wall being the edge of the stage).  I am open to any suggestions.

Powered by ScribeFire.







Wednesday, September 30, 2009

Algorthims

Year 2 started out 5 weeks ago with an algorithms class. Luckily enough, it still uses C++, which I still find to be the most comfortable with.

The teacher is a hard ass, yet good. He is one of those teachers that will yell at the class for not being quick enough, or giving answers that he thinks are beneath us. At the same time, he is the most respectful and encouraging teacher; he can give a student hell in one breath, then in the next, heap raise on the same student for showing effort.

The first two assignments covered basics like flowcharting and array subscripts. The algorithms teacher is more concerned at this point, with us producing clean code; appropriate comments, and a readable, consistent style.

It is a class about thinking, and less about syntax.

He is a very old school programmer, using ideas from K & R. For example, right now we are doing an excercise in C-Strings, and passing 2-D arrays to functions. This is also bundled with an program that has different sorting algorithms.

An example of the code I wrote today:

#include <iostream>
#include <iomanip> //for setw function to format output
using namespace std;

const char title1[] = { "Unsorted Array Data" };
const char titleWt[] = { "Weights" };
const char titleName[] = { "Names" };

const int L_MAX = 100; //maximum number of name strings in array
const int N_MAX = 10; //maximum size of each name string
const int L_SIZE = 20; //number of actual name strings in array


// Function Prototypes -------------------------------------------------------------

void OutList( const char[], const char[] ,const char[], char[][N_MAX], int[] );

// ---------------------------------------------------------------------------------

int main()
{
//array of name strings
char names[L_MAX][N_MAX] = { "wendy", "ellen", "freddy", "tom", "susan",
"dick", "harry", "aloysius", "zelda", "sammy",
"mary", "hortense", "georgie", "ada", "daisy",
"paula", "alexander", "louis", "fiona", "bessie" };

//array of corresponding weights for those names
int wt[L_SIZE] = { 120, 115, 195, 235, 138, 177, 163, 150, 128, 142,
118, 134, 255, 140, 121, 108, 170, 225, 132, 148 };

OutList( title1, titleName, titleWt, names, wt ); // print raw data


return 0;
}

void OutList( const char title[],const char nameTitle[], const char wtTitle[], char name[][N_MAX], int wt[] )
{
// prints the unsorted array of names / weights

cout << title << endl << endl;
cout << left << setw(12) << nameTitle << left << setw(12) << wtTitle << endl << endl;

for ( int count = 0; count < L_SIZE; count++ )
cout << left << setw(12) << name[count] << left << setw(12) << wt[count] << endl;

system ( "pause" );

}

The function Outlist() is not my favourite I have ever written. There are too many arguments, it is too easy to get lost, which leads to debugging nughtmare. Three arguments should be the maximum. Thoughts on this?

What did me in with the last assignment, was not that my program did not work, in fact it worked perfectly, I did not comment my code properly. If any one has any suggestions on how I should comment code in a way tht would please an old school programmer, let me know.




Powered by ScribeFire.