So what is Line Fighter? Line Fighter is a flash game where you draw your own adventure game using the mouse and are able to set monsters, traps, and a flag at the end of your level. Survive all the traps and kill all the enemies in a level to win. You can save with a copy/paste level code, and even load anybody elses level.
I'd like you guys to tell me what you think, what bugs you can find, and I'd also love to see some levels you've made .
well, i like the idea alot. the implementation, not so much, for 3 reasons:
1.no erase button. also, you should disable any type of drawing while clicking any of the items in the menu, it adds unwanted traps and such.
2.the character attacks slow, and weak(and looks bad as well). since the enemy (bat in this case) isn't forced to recoil, he can attack you twice as fast as you can attack him. plus, it takes too long to reposition your character to where he will actually hit the enemy
3.the character movement on slopes needs to be improved greatly. at one point, i could jump next to a slope and go right through it because when i was "bumped up" from hitting the slope, the new position was out side of the wall
other than those 3 issues, i think its a really cool idea.
I see your point, ive been thinking of adding an undo button for a while now but im not sure how I would implement it, an erase button would be way beyond me however. Also you're right, I need to make it so you don't get those extra drawings and unwanted traps, as for the enemy attacks and etc it could be because the game is lagging possibly ? Maybe try lowering the quality.
i have no experience with this type of game really, but an eraser seems like it'd be super easy. when the character draws anything, that object should be added to an array. so, when the character chooses the eraser option, some kind of small graphic would follow the mouse around and on a mouse down event, simply loop through the array of objects to see if one as hit the eraser movie clip, and if so, remove it, and splice it out of the array.
let me rephrase my comment about the enemy attacks:
once you attack the enemy, it can attack you back instantly, regardless of whether you are still attacking it.since the attacks are simple melee attacks, it is impossible to hit the enemy without getting hit yourself, therefore, no skill is needed, as you will always die after you attack an enemy so many times(if there are three enemies, and you have only 2 health units. you would not be able to complete the level if each enemy took away one health unit per attack).
2 ways you could improve that though:
a) simply cause the enemy to be "thrown back" about 10 pixels or so in the direction of the characters attack
b)change the attacks to distance attacks such as a pistol firing and teach the enemies AI to dart in towards the player to attack and then dart back away from the player after it has attacked
Last edited by squidgie90; 02-16-2008 at 09:54 PM.
Thank you thats much easier to understand, heh don't overestimate my intelligence just because I made a complicated game . Anyway, an erase button I'm not quite so sure would be so simple because how would the game know exactly what curve you're hitting into when its all a single movieclip? but im certain I could remove the last array added and redraw the lines with an undo tool. Im going to test what you said about pushing the enemies back, my typical strategy is lure the enemy, hit with melee attack, run back.
that strategy works BUT if you get trapped in a corner, you can't jump over the enemy because he moves directly towards you at a speed faster than you can move away from it. therefor, you'd have to fight your way out, but, seeing as the enemy has no fear whatsoever of your fists, or stomach in this case i guess, he relentlessly pumels you in the same spot.
um, redrawing all the lines like that would seem a little over complicated not to mention, inefficient.
essentially, the new array would be the exact same as the first array, except it has one less movie clip in it
so if you have 1000 objects in your array, the new array would be 999 units long. so, you'd have to recreate 999 new objects, instead of just removing 1.
Last edited by squidgie90; 02-16-2008 at 10:18 PM.
I'm not sure but I don't think its actually possible to remove lines in flash. You see, my game doesn't actually draw the lines directly from the array it uses a basic line to and the load function redraws a full array of your level. So the only way to do any sort of erasing would be to remove the unwanted thing from the array and load the new level, naturally.
Well heres a chunk of my brush code:
if (apples == true){
if (apples2 == true){
}
_root.menu.color= 000000;
if (apples2 == true){
terrain.lineStyle(_root.brushsize, 0x000000, 100);
}
imdrawing = false;
onMouseDown = function () {
if (imdrawing == false) {
if (apples2 == true && _root.win._currentframe == 1){
if (determined != true) {
}
}
determined = true;
imdrawing = true;
}
if (imdrawing == true ) {
if (apples2 == true){
terrain.lineStyle(_root.brushsize, 0x000000, 100);
onMouseMove = function () {
if (_root.win._currentframe == 1){
if (determined == true) {
if (Isset != true){
terrain.moveTo(_xmouse, _ymouse);
undoArr.push("."+_xmouse+",."+_ymouse);
pointXArr.push("."+_xmouse+",."+_ymouse);
Isset = true;
}
terrain.lineTo(_xmouse, _ymouse);
undoArr.push(""+_xmouse+","+_ymouse);
lineSkip += 1;
if (lineSkip == 3) {
pointx = _xmouse;
pointy = _ymouse;
lineSkip = 0;
pointXArr.push(""+pointx+","+pointy);
}
}
}
};
}
}
}
See, it draws directly from the mouse and makes it into the terrain movieclip, it also moves the lines into an array to be loaded possibly in the future. Actually removing a part of that specified with an erase tool is far beyond me, and I'm trying an undo tool with no success either -.-.
hmm, lot of conditionals there. little hard to understand outside of a code block too. let's see, if i was gonna draw lines like a line tool, this is probably how i'd do it:
PHP Code:
d=0
lineArray = []
startx=0
starty=0
endx=0
endy=0
function drawLine(){
//create new line
line=_root.createEmptyMovieClip("line"+d,++d)
line.lineStyle=(2,0x000000,100)
//line starts where the mouse button was pressed
line.moveTo(startx,starty)
//line ends where the mouse button was released
line.lineTo(endx,endy)
lineArray.push(line)
}
onMouseDown = function(){
startx=_xmouse
starty=_ymouse
}
onMouseUp = function(){
endx=_xmouse
endy=_ymouse
drawLine()
}
function undo(){
//little sketchy here about removing the last movie clip
//lineArray.pop() will return the last item in the array
lineToDelete=lineArray.pop()
//i think that that item can be deleted as follows
lineToDelete.removeMovieClip()
}
undoButton.onRelease = undo
off the top of my head, so if it doesn't work, sorry. i hope the undo function works...lol
Last edited by squidgie90; 02-16-2008 at 11:34 PM.
here's a demo .fla. click and drag anywhere within the white space to draw a line. then press the undo button. draw as many as you like. it will delete them one at a time in the order that they were drawn. btw, the reason the undo button doesn't work for you is because of the extra parentheses(sp?) at the end of the function
Last edited by squidgie90; 02-17-2008 at 12:22 AM.
I see, I've got it working in my game using your code and everything im just having trouble getting my hero to hitTest properly with all the created clips.. This is the code I'm trying to use:
for (var i = 0; i<_root.lineArray.length; i+= 1) {
if (Key.isDown(Key.LEFT)) {
if (!_root.lineArray[i].hitTest(_x-_width/2, _y+_height/4, true)) {
_root._x += xspeed;
_root.menu._x -= xspeed;
this._x -= xspeed;
_root.flag._x -= xspeed;
}
}
}
My character absolutely refuses to hitTest the created clips as it would with just one clip. I got it now so it can hit the most recently added line but no others -.-