Thanks for all the reply's
After a little looking on the web I soon realised that making a game is quite complicated, so I decided to go with the flash route and use action script, As I already have flash and have used it to make some animations but never got as far as using action script.
I found a few tutorials with all the different game elements I wanted. But the problem I am having is to bring them all together.
I started of with a single picture of my character, and got him to move left and right, then brought in acceleration and friction, so he slides around a little.
The I used another tutorial to animate the character so when he moves left and right he looks like he is walking and when he stops he stays still.
Then I found a tutorial on how to make your character jump which usually goes a messed up. Gravity works, but I cant seem to get the blocks to act as ground, he just falls through them.
So At the moment I want to create a game like this.
http://www.gotoandplay.it/_articles/2003/12/scrolling_upd.php
But I when I try and download the tutorial I get a page of gibberish.
The code I have got so far is this
onClipEvent (load) {
power = 0.3;
yspeed = 0;
xspeed = 0;
friction = 0.95;
gravity = 0.1
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
xspeed -= power;
}
if (Key.isDown(Key.RIGHT)) {
xspeed += power;
}
xspeed *= friction;
yspeed += gravity;
_y += yspeed;
_x += xspeed;
}
Can any one help me, I need a way to tell the character to stop falling when he hits the ground. A Jump command. And a way to make the screen scroll from side to side as he walks.
I found this code which does the side scrolling part but I cant figure out where in the code it appears
onClipEvent (load) {
speed = 0;
maxmove = 15;
}
onClipEvent (enterFrame) {
if (_root.dead) {
this.gotoAndStop("dead");
} else {
speed *= .85;
if (speed>0) {
dir = "right";
} else if (speed<0) {
dir = "left";
}
if (dir == "right"){
this._x += speed;
_root._x -= speed;
}
if (dir == "left") {
this._x += speed;
_root._x -= speed;
}
if (Key.isDown(Key.LEFT)) {
if (speed>-maxmove) {
speed--;
}
this.gotoAndStop("run");
this._xscale = -100;
} else if (Key.isDown(Key.RIGHT)) {
if (speed<maxmove) {
speed++;
}
this._xscale = 100;
this.gotoAndStop("run");
}
if (speed<1 && speed>-1 && !attacking) {
speed = 0;
this.gotoAndStop("idle");
}
}
}
I dont expect anyone to rewrite my code for me. but any help or guidance or direction to a tutorial that works would be great.
I think once I get my character working, and the scrolling part of the level working I should be able to achieve what I am aiming for.