Friday, June 6, 2008

Wednesday, June 4, 2008

JJJFFFJFJFJFJFJFJJJFFFFFFJJJFFFJJJJFJFF

Ok ... type to learn lesson one: F and J

Actually I made the background scroll with the guy ... soon this will be added to the website, but I need to be at home to do that...

Here is the segment of code used:

if(_root.player._y > 100){
_root.player._y -= 2;
} else {
_root.wall._y += 2;
}
Okayyy, so here we have an if statement determined by the position of the player on the y axis. If the player's y value is greater than 100 (remember y axis is reversed in flash) the player will move up (y-2) and if the player is less than 100 (near the top) the wall will move down instead of the player moving up.

This all gives the effect of the player moving up, yet the player will never reach the edge of the screen because as soon as it hits the y = 100 point the wall will move instead!

SWF coming soon!

Tuesday, June 3, 2008

ASDFGHJKL

Here are a few of my .swf's :

http://www.maxhardcastle.com/Indy2008/IndyIndex.html

Hope that clears up the program from before (It's the one titled Trigonometry) ...

Monday, June 2, 2008

ABCDEFGHIJKLMNOPQRSTUVWXYZ

OKAAAAAAAAYYYY

So the four corner point thing didn't work out so well... It's basically a lot more buggy than the first version, but perhaps I messed up a corner. Who knows.

In other news I've been working with some trig and managed to make a rotating circle program. I think I might dedicate a page of my website to Flash swf's since I learned the other day that I have 300gigs of space to use (maxhardcastle.com server thing).

Here's a snippet of code from that program outlining some new stuff:

angle = Math.atan(mousex/mousey)

xval = _root.circle._x + radius*Math.cos(angle);
yval = _root.circle._y - radius*Math.sin(angle);


New terms:
Math.atan - This is the "arctan" or inverse tangent function ... returns a value in radians ...
Math.cos - cosine...
Math.sin - sine...
and later on:
Math.PI - 3.141592653584626 (That's all I can remember... might be wrong)

Here the code finds the angle that the mouse creates in relation to the center of the coordinate plane designated by the center of the movie clip that this code resides in. That might seem complicated, but it really isn't. There is a circle on the screen, the center of the circle is the origin. Imagine there is a point where the mouse is, now draw a line from that point to the origin, and then find the angle of that line in relation to the x axis.

The second part calculates the x and y coordinates where the imaginary line from the mouse crosses the circle on the screen.

As I mentioned earlier, all this would be so much easier with an example of this program because it's hard to describe exactly what I have created.

if( mousey > 0 ){
degrees = ((((Math.atan(mousex/mousey))*(180/Math.PI))+90)+180);
}
if( mousey < 0 ){
degrees = (((Math.atan(mousex/mousey))*(180/Math.PI))+90);
}


This code finds the angle the mouse creates in degrees (normally it's in radians) hence the name of the variable "degrees" ...

Flash movies coming soon! (I hope)

Friday, May 30, 2008

BLOGGERRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR

That's not going to be an annoying title!

wELCOME TO www.b.loggar.net (it's dot com!)

here is some new code for wall hit test that works relly G00D(ly):

onClipEvent(enterFrame){

var radius:Number;
radius = ((_root.player._width)/2)

var position:Array = new Array();
position[0] = (_root.player._x); //up
position[1] = (_root.player._y - radius);
position[2] = (_root.player._x + (radius*cos(45)));
position[3] = (_root.player._y - (radius*sin(45)));
position[4] = (_root.player._x + radius); //right
position[5] = (_root.player._y);
position[6] = (_root.player._x + (radius*cos(45)));
position[7] = (_root.player._y + (radius*sin(45)));
position[8] = (_root.player._x); //down
position[9] = (_root.player._y + radius);
position[10] = (_root.player._x + (radius*cos(45)));
position[11] = (_root.player._y - (radius*sin(45)));
position[12] = (_root.player._x - radius); //left
position[13] = (_root.player._y);
position[14] = (_root.player._x - (radius*cos(45)));
position[15] = (_root.player._y - (radius*sin(45)));

if(Key.isDown(Key.DOWN)){
if(!(_root.wall.hitTest(position[8], position[9], true))){
_root.player._y += 2;
}
}
if(Key.isDown(Key.UP)){
if(!(_root.wall.hitTest(position[0], position[1], true))){
_root.player._y -= 2;
}
}
if(Key.isDown(Key.LEFT)){
if(!(_root.wall.hitTest(position[12], position[13], true))){
_root.player._x -= 2;
}
}
if(Key.isDown(Key.RIGHT)){
if(!(_root.wall.hitTest(position[4], position[5], true))){
_root.player._x += 2;
}
}
}


So yeah... I haven't implemented the four corner points yet but the other ones work.

Explanation: the player can move right unless the right side of the body hits the wall etc.

shreck is a darth red and black painted person

btw player is a mc that is shape in a circal

Thursday, May 29, 2008

Maybe A good blog

I have been working on AI:

var time:Number = 16.66;
var delay:Number = 16.66;

function walk(){
_root.circle._x += 3;
clearInterval(delay);
}

delay = setInterval(walk, time);


Sets two variables, creates a walk function, and the final line executes the walk function over an interval (setInterval). Delay is how often it executes the interval and time is how often it executes the function (I think).

Friday, May 16, 2008

Game is coming along fine now.

TODO:
1) write better blogs. (ones that have capital letters at the beginning of each "sentence")
2) limit power on the laser (chance for upgrades)
3) make levels and make Ethan draw cool pictures for the levels