Tuesday, February 26, 2008

And Contra

And a Contra like game!  That would be awesome.  ALthough the way I have things currently set-up, it would be possible.  Each action (like a mouse press or key up) cancels whatever was happening before, like the right arrow key held down.  So if you were running and shooting, you'd have to press the run button again, otherwise you would stop. 

Monday, February 25, 2008

Beginning Project 1

Project 1 has been very interesting so far. Much of it is because I can't make up my mind of what I want to do. Part of me really wants to do a cool physics platformer, with grappling hooks and levels and all sorts of cool stuff, while the other half wants to do a strategy game, like Advance Wars. Yet a another half could be up for doing a mini-game compilation; I did one back in high school and it was lots of fun to make.

This is what I have so far though:
This one is pretty basic. The block can jump (on release of the spacebar) onto each of the platforms. Also, it can move left and right with the arrow keys, and it even comes with fancy physics/friction. Working through this gives me great respect for the guys behind Mario Bros. (Especially 3, which had momentum I think). They are able to produce a fun, responsive game. Meanwhile, mine feels a little loose, and doesn't nearly have the perfect controls (especially in the air). The next step for me is to have the character bounce off the walls of the platforms, as now it can go straight through them. Other things that would be good to do as well would be scrolling, having actual graphics, and being able to fall through platforms (with like down and jump).

While playing around with the window size, I thought it might be fun to have a game where dragging the actual window resizer would be the control for the game. But what is a test render in Flash is not an online browser. The browser really chugs.


This second test was trying to get legs act for themselves. It took much longer than I expected it to, and it's still kind of clunky. For whatever reason it doesn't always work (I think it has to do with the speed the character is coming down). All he can do is jump. if you hold down spacebar he prepares, and launches when you let go. Some of the problems are that the legs separate, and it doesn't always register a landing by bending the legs (as described above). Originally I was going to put two feet in (the long, vertical box at the bottom), but it really made flash chug-a-lug. Like really bad. I was surprised...my code must be too clunky! As well, the code isn't too versatile. The legs will only work when the thigh and calf beginning and ends are directly above each other. One of the reasons I wanted to do this was so that my character could animate himself, and be able to stand on sloped ledges, and respond to the environment.


After all of this though, I need to get cracking. This is all cool and whatnot, but how useful to an actual game? I think the latter especially is more for fancy sake rather than solid gameplay. This coming up week I need to pick a project and go with it! Even if it's a bunch of boxes (which would be bad, since I always do that), as long as it's a solid, moderately fun game I'll be happy).

Oh, and I did make a loading screen/intro screen for the first file, but I forgot to publish it that way. Sorry! And both of these files allow double, triple, quadrupile...jumping. Good for getting back to the platforms in the first one and good for breaking the second!

Monday, February 11, 2008

Exercise 3.3

Wow, Flash files done completely in ActionScript (minus the movie clips) are amazingly small!  3.2 was a whopping 107KB, but this file was 2KB.  Holy crap!  (although upon further reflection, the difference is not in using Actionscript, but the fact that this had no image files in it...d'oh!)

Although, it is not quite as intuitive to write everything in ActionScript.  As much as I like to write it all in different files, doing it as a layer in Flash is easy, and convenient since everything is on one page.

This project wasn't too bad.  I just kept forgetting to link the MovieClips with actual code/files, so that was the only problem I had.  One cool thing it does (totally unplanned) is that shooting closer to the blue square makes the particles slow, but far away they move fast.  Pretty nifty.

Single Player Coop

Oh, and single player coop (while probably really difficult to do, and twice the amount of work) is a really cool idea for a game. Like Resident Evil 4 with Ashley, or ICO with the princess. It helps put a different spin on things, being able to always have someone going with the character. Kind of what they do in Half Life 2, where all of the characters with you flesh out the story, and keep you company.

Exercise 3.2


So for the first of three, I did a simple car moving along the screen. It accelerates, and the car even rotates to show the intensity of its speed. Although when the shadow rotates with it it looks kind of silly. Maybe if all of this wasn't so scripted...

The second one is an extension of the first, but this time the ball moves in two directinos, so both X and Y accelerations are being calculated. The car shoves off with predetermined constants, giving it a still scripted feel...

The final of the three, which was the most difficult and time consuming, is definitely my favorite. Even though some of it is still scripted animation, much of it is not. The robot pulls his arm back through constants, but after that the arm is given initial velocity and the rest is math. Probably not the purest of math or physics, but it still looks pretty good. The most difficulty with the swinging arm was getting it to stop. The most effective solution was to cut the velocity in half whenever it was at neutral (straight down) position. The car, however, is completely code. Through trig, the car is attached to the arm, moving and rotating accordingly. This was exceptinoally hard to do, and probably took the longest amount of time. The problem was in the arm's rotations. I thought it had to do something with Flash's rotation scale, but it ended up being that I was thinking in degrees, not radians.  Whoops. Anyways, once the car reaches a certain rotation, it detaches from the robot and then is affected by gravity. The lauch position is completely alterable, so changing the value will change the trajectory. Take a better look at it here:

Dog's Solution

Can you name the game?

The exercise was fun though, and very rewarding. It's a good reminder of how long getting code to work well takes (even for the simpliest of things!)

Monday, February 4, 2008

Exercise 2

Here's some of the new animation I did. They take much longer than I anticipated. Much of it is getting used to drawing backwards. Normally when I draw a still image I just go in and start, but with animation there's a lot more planning. If all of the details aren't sorted out first, it's going to end up crappy and I'll have to start over. The left one is walking and the right is an idle position, although he's moving quite fast in that one.



As for Exercise 2, I had some of it done. It wasn't frustrating work, but it's certainly not as intuitive as I though it was going to be. I ended up only being able to get a blue box to spin left and right, as well as duck. It was strange because I tried to do it with my character and it refused to work.



I also tried to whip out some ActionScript magic, but I've forgotten more than I thought I would in a month or two. That, and the assignment specifically asked for actions in the stage, not as separate ActionScript files.