Friday, December 6, 2013

Add Keyboard Control

Already done the controls, along with sprinting. I just need add the obstacles. The obstacles will be tricky as when you touch them, they will need to put you in a fixed position, but not as to trap you.

Thursday, December 5, 2013

Move with Game Loop

I almost always put my code in the "onEnterFrame" part. In my hidden objects game, the only code outside was code to preset the game. So in this case, I already had the moving part in the code along with a sprinting move. I started an obstacle, but the "_root" code has a bug that I'm having trouble with. Other than that, I'm fine.

Program first action

Since I've been here since last year, my coding experience is alright, so I went straight to programming the character once I finished it. I got the standard character movements in, so it moves left, right, up, and down, but to add to that, I added a "sprint", where you hold down shift along with any other key. The type of code I used was:

if(Key.isDown(Key.[Any Arrow Key])){
character._x -= [Number]
}

and the sprinting aspect adds more to that number, so it would be like this in the end:

if(Key.isDown(Key.LEFT)){
character._x -= 6
}
if(Key.isDown(Key.SHIFT) and Key.isDown(Key.LEFT)){
character._x -= 10
}

So, this allows the character to move left and sprint left. I also added the code to make the character spin left or right whenever you go that way.

character._xscale = -100

Makes the character look the opposite way than where it is currently facing.

Create Movie Clip

The character, BOT, is a nanobot tasked in finding and catching an corrupt nanobot. The corrupt nanobot was originally a top secret nanobot, but it was corrupted and is going to fall in the hands that others don't want it in. BOT was made to stop and capture the corrupt nanobot, but at their sheer size, they also need to battle with the atoms, which have become obstacles to them.