Thursday, September 30, 2010

Space Invaders - early stages



As you can see I'm drawing the most of the objects right now. I have the monsters moving in a block. I made a EnemyBlock container class, since they all move as a group and not individually, and I just have the EnemyBlock class contain an array of Enemy objects. The EnemyBlock controls the Enemy objects and the main game only interacts with the block. I also created a Barrier object as well as a BarrierBlock to control the group of 3 barriers. The ship is just moving automatically at this point, I haven't added any keyboard listeners just yet.

Mostly I just wanted to upload my SpaceInvader (looking) screenshot.

Wednesday, September 29, 2010

Homework 3: Completed



As you can see I now have 3 objects bouncing around the screen. The box goes side-to-side, the triangle goes up and down, and the "ball" (I chose a picture of my 1 year old son) bounces around all of the sides.

I've made quite a few changes since the last post. I went ahead and made a MovingObjects superclass and subclassed Box, Ball, and Triangle off of it. This prevented any code-reuse as most of the work is being done in the superclass and the subclasses are mostly just setting environment up.

I have a big aversion to putting any constants in my programs, so I created a MOProperties file that reads in all of the environment (Panel size, object velocities, FPS, etc).

The MovingObjects Panel class was based on the WormChasePanel class. In-fact it's really just a heavily modified copy of the WormChasePanel class, where I took out the irrelevant parts, and added a few pieces that I needed. The MovingObjects main class is also based on the WormChase class, again very heavily modified.

I wasn't really clear on the assignment so I didn't know if we needed to add in any transparency. As such, my triangle and "ball" have white space around them, which can be more easily seen when they overlap. I wasn't sure how to correct this, since we discussed it in class, but not how to actually do it.

Fun assignment, looking forward to working on space invaders.

Saturday, September 25, 2010

Homework 3: Work-in-progress



I started off by simply modifying the WormChase application and replacing the Worm and Obstacle classes with 4 new MovingObject classes. Currently I'm using a MovingObject interface, and just implementing that interface with the Ball, Square, and Circle objects.

I haven't touched the rest of the application yet and I'll probably end up re-writing most of the main-loop stuff shortly.

The image is of the ball and square going up and down/side to side.

Monday, September 13, 2010

Installing Java3D


I went to the link and downloaded Java3D. Once it was downloaded I found the directory where it downloaded to and I realized I already had it from before (probably when I was looking at Java Monkey Engine). First thing I did was open up Eclipse and copy and paste the HelloUniverse.java code into the IDE.

As expected it showed an error, something about permissions on the Java3d Jar file. Okay, lets read the instructions. The Instructions tell me just to run:
> javac HelloUniverse.java

Okay, this works now:

> java HelloUnivese

Okay, looks good. Nice spinning cube. Now why isn't Eclipse working with Java3d? I check the build path and it can see Java3D no problem.

Looked it up online, most people said to manually add the jar file to the project, which I did. I then moved them above the standard library and it worked just fine. Spinning cube in Eclipse as well.

Sunday, September 12, 2010

First Post - Troubles with Perforce

This was my first time looking at Perforce and from first glance it's quite similar to CVS and Subversion.

I can't decide if it's compatible with Eclipse yet, I'll have to figure out how it works with Eclipse another time.

I initially installed it on my PC (running Windows 7) and when I tried to add a file it said "1 warning reported, C:/SE456/test.txt - no permission for operations on file(s)." I messed around with the permissions on my SE456 directory and nothing works. Looked up the error online and several people seem to have had it, but they all typo'ed somewhere or something and got it to work.

Okay, I'm thinking it's a quirky Windows bug, so I switch to my Mac. Same error, can't just be a coincidence, I'm doing something wrong.

Back to the PC again.

Okay, this time I'll pull down the sample file from the Depot. Okay that worked, and it created some additional directories inside my C:/SE456. Okay I'll try to upload into one of those created directories, okay that worked.