Create an Eskiv Flash game tutorial

Do you know a Flash game called Eskiv? No?

Never mind, it’s not the best game around there, but there is a thread called Eskiv Clone? in the forum asking help in making a game like that one.

First, play it a minute

Then, take this prototype, starting from an old tutorial called Flash game creation tutorial – part 1.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
_root.attachMovie("score","score",1);
_root.attachMovie("hero", "hero", 2, {_x:250, _y:200});
_root.attachMovie("target", "target", 3, {_x:Math.random()*400+25, _y:Math.random()*300+25});
power = 3;
enemy_power = 5;
points = 0;
hero.onEnterFrame = function() {
	if (Key.isDown(Key.LEFT)) {
		this._x -= power;
	}
	if (Key.isDown(Key.RIGHT)) {
		this._x += power;
	}
	if (Key.isDown(Key.UP)) {
		this._y -= power;
	}
	if (Key.isDown(Key.DOWN)) {
		this._y += power;
	}
};
target.onEnterFrame = function() {
	dist_x = this._x-hero._x;
	dist_y = this._y-hero._y;
	distance = Math.sqrt(dist_x*dist_x+dist_y*dist_y);
	if (distance<(hero._width+this._width)/2) {
		points++;
		score.scoretxt.text = points;
		this._x = Math.random()*400+25;
		this._y = Math.random()*300+25;
		foe = _root.attachMovie("enemy", "enemy", _root.getNextHighestDepth(), {_x:Math.random()*400+25, _y:Math.random()*300+25});
		foe.dir = Math.floor(Math.random()*4);
		foe.onEnterFrame = function() {
			switch (this.dir) {
			case 0 :
				this._x += enemy_power;
				if (this._x>500-this._width/2) {
					this.dir = 1;
				}
				break;
			case 1 :
				this._x -= enemy_power;
				if (this._x<0+this._width/2) {
					this.dir = 0;
				}
				break;
			case 2 :
				this._y += enemy_power;
				if (this._y>400-this._width/2) {
					this.dir = 3;
				}
				break;
			case 3 :
				this._y -= enemy_power;
				if (this._y<0+this._width/2) {
					this.dir = 2;
				}
				break;
			}
			dist_x = this._x-hero._x;
			dist_y = this._y-hero._y;
			distance = Math.sqrt(dist_x*dist_x+dist_y*dist_y);
			if (distance<(hero._width+this._width)/2) {
				points--;
				score.scoretxt.text = points;
				this.removeMovieClip();
			}
		};
	}
};

And this is the result

Move the purple ball with arrow keys and take the red one. Avoid blue ones and score as much as you can.

This version has better collision detection than the original one

Download and play with it

Rate this post: 1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 3.00 out of 5)
Loading ... Loading ...
Flash Templates provided by Template Monster are pre-made web design products developed using Flash technology.
They can be easily customized to meet the unique requirements of your project.
Be my fan on Facebook and follow me on Twitter! Exclusive content for my Facebook fans and Twitter followers

This post has 22 comments

  1. Mike

    on April 30, 2008 at 7:26 pm

    Very nice, but you sould starting doing tutorials on AS 3.0, since they are so few out there.

    It’s a helluva hard to learn, but if we don’t start now we never will…until AS 4.0 comes out and then AS 2.0 becomes obsolete and most of the content on this blog.

  2. Mike

    on April 30, 2008 at 7:32 pm

    Oh and by the way, is the possible for you to add categories for AS 2.0 and AS 3.0?

    You probably wrote some As 3.0 games, but I don’t know where to find them.

    Take care.

  3. JDog

    on April 30, 2008 at 10:59 pm

    I bet that guy will be super happy to read this !

  4. Xavi-v

    on May 1, 2008 at 12:09 am

    weird, the .swf doesn’t show up on my browser
    =(

  5. Galaxian

    on May 1, 2008 at 5:54 am

    The clones are already popping up on NG… Man, if I could only get some graphics together, before people get bored of it. Nice tutorial.

  6. limpeh

    on May 1, 2008 at 11:40 am

    Nice tutorial. However, I’ve found that I can just ‘avoid’ those ‘bouncy things’ by moving myself out of the ‘gaming area’ :p

  7. Emanuele Feronato

    on May 1, 2008 at 12:37 pm

    Yeah, it’s just a prototype and allows you to cheat easily, but it’s also easy to fix that issue…

  8. Kabomb

    on May 1, 2008 at 1:35 pm

    Hey,

    I remember having this game on my graphic calculator. I don’t think Eskiv was the first version of this game but nevertheless it was a fun addicting time waster.

    I think the best thing you did to improve it was take only 1 off when you get hit instead of having to reset at 0. Also maybe you could make the vertical and horizontal dots a different colour? When I’m moving I always move in a vert or hoz direction and I only look for one direction at a time so maybe that could be useful.

  9. Colonel

    on May 2, 2008 at 11:45 am

    Thanks for this. I’ve managed to do the same thing but Ive made it much more complicated for myself! good work!

  10. EagleVision

    on May 2, 2008 at 5:31 pm

    Very addicting…Clones, clones…

    I might make a game out of this.

  11. ddar

    on May 5, 2008 at 11:05 am

    how to make gaeover for this one?

  12. JDog

    on May 9, 2008 at 9:50 pm

    Lives ?

  13. The Dog

    on May 9, 2008 at 9:58 pm

    Infact, how would you get the enemy to spawn on the targets location ? I don’t know why you would want to do that, but just in case =D.

  14. Creation of a Flash highscores API - Step 2 : Emanuele Feronato - italian geek and PROgrammer

    on May 15, 2008 at 10:57 pm

    [...] not an hard prototype once you read Create an Eskiv Flash game tutorial (in order to have a real game) and Managing savegames with Flash shared objects (to store data on [...]

  15. Jamag: a Flash game you’d better master : Emanuele Feronato - italian geek and PROgrammer

    on May 20, 2008 at 9:14 pm

    [...] While my second one-week game is still under level design, I released this game based on the Eskiv prototype. [...]

  16. Ashley rudge

    on May 28, 2008 at 6:23 am

    Hey i edited this game to make the blue balls ghost from pacman and the players character pacman i have a slight problem that i want animation to happen so when i press left it makes his mouth face that way with his mouth opening and shutting plz help

  17. Amy

    on May 31, 2008 at 2:19 pm

    Hi!
    I love this tutorial. Im making a game as we speak but I was wondering could you explain some coding so I can understand it better?

  18. ameer

    on July 23, 2008 at 8:01 am

    hi it’s really very nice games. good! thank you

  19. Abbot

    on October 10, 2008 at 10:50 am

    Hey, very nice, I myself did the same thing, except in video format, and step by step explaining of code for the base engine on my Eskiv remake ‘Dodge It’

    http://www.callistek.com/store/index.php?main_page=product_info&cPath=1&products_id=1&zenid=hjhei54mdudef253lfaubmef61

    You can find the game at:
    http://goofygamer.com/games/flash/popular/300/Abbots-Dodge-It/

    Very very similar to eskiv if you notice :D I love eskiv.

  20. Nacho_man

    on December 4, 2008 at 11:29 pm

    How do i change the point value

  21. Olof

    on May 11, 2009 at 5:24 pm

    Very nice guide. But i wonder if you are gonna do an as3 tutorial to.

  22. Lisa

    on November 27, 2011 at 3:49 pm

    This is great. I am using the original Eskiv game to create my own game for an assignment. But what I need to know is how to change the speed of the balls so I can have multiple levels in my game. Please help. Thanks.