A Flash Developer Resource Site

Page 1 of 3 123 LastLast
Results 1 to 20 of 44

Thread: [BETA] Line Fighter

  1. #1
    Member
    Join Date
    Jul 2006
    Posts
    69

    [BETA] Line Fighter

    My game is just about ready to released, I'd just like it to be tested first.

    You can play it here:
    http://www.allgamesallfree.com/content/linefighter.html

    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 .

  2. #2
    Senior Member
    Join Date
    Oct 2006
    Posts
    221
    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.

  3. #3
    do your smiles love u? slicer4ever's Avatar
    Join Date
    Dec 2005
    Location
    in a random occurance
    Posts
    475
    good idea but as squibgie90 mentioned some things do need to be fixed

  4. #4
    Member
    Join Date
    Jul 2006
    Posts
    69

    Eraser and etc

    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.

  5. #5
    Senior Member
    Join Date
    Oct 2006
    Posts
    221
    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.

  6. #6
    Member
    Join Date
    Jul 2006
    Posts
    69
    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.
    Last edited by ab9003; 02-16-2008 at 10:05 PM.

  7. #7
    Senior Member
    Join Date
    Oct 2006
    Posts
    221
    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.

  8. #8
    Member
    Join Date
    Jul 2006
    Posts
    69
    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.

  9. #9
    Senior Member
    Join Date
    Oct 2006
    Posts
    221
    im confused, but, obviously, your method is different from what i probably would have done, so my techniques are voided lol

  10. #10
    Member
    Join Date
    Jul 2006
    Posts
    69
    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 -.-.

  11. #11
    Senior Member
    Join Date
    Oct 2006
    Posts
    221
    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.

  12. #12
    Member
    Join Date
    Jul 2006
    Posts
    69
    Argh I can't even get the drawing part of that to work lol =X

  13. #13
    do your smiles love u? slicer4ever's Avatar
    Join Date
    Dec 2005
    Location
    in a random occurance
    Posts
    475
    edit: nvm took too long writing this out

  14. #14
    Senior Member
    Join Date
    Oct 2006
    Posts
    221
    lol, let me put it into flash and test it
    edit: lol, my bad.
    the line:
    line.lineStyle=(2,0x000000,100)
    should be:
    line.lineStyle(2,0x000000,100)
    Last edited by squidgie90; 02-16-2008 at 11:48 PM.

  15. #15
    Member
    Join Date
    Jul 2006
    Posts
    69
    Heh I got it working:
    d=0
    var lineArray:Array = new Array();
    startx=0
    starty=0
    endx=0
    endy=0
    createEmptyMovieClip("line", 20);
    onMouseDown = function(){
    startx=_xmouse;
    starty=_ymouse;
    trace(startx);
    line.moveTo(startx,starty);
    }
    onMouseUp = function(){
    endx=_xmouse;
    endy=_ymouse;
    line.lineStyle(2,0x000000,100);
    //line ends where the mouse button was released
    line.lineTo(endx,endy);
    lineArray.push(line);
    trace(endy);
    }
    function undo(){
    lineToDelete=lineArray.pop();
    lineToDelete.removeMovieClip();
    }
    undoButton.onRelease = undo();

    Sadly the undo function does not work, all it does is delete the whole drawing.
    Last edited by ab9003; 02-16-2008 at 11:52 PM.

  16. #16
    Senior Member
    Join Date
    Oct 2006
    Posts
    221
    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
    Attached Files Attached Files
    Last edited by squidgie90; 02-17-2008 at 12:22 AM.

  17. #17
    Member
    Join Date
    Jul 2006
    Posts
    69
    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;
    }
    }
    }
    Last edited by ab9003; 02-17-2008 at 01:25 AM.

  18. #18
    Senior Member
    Join Date
    Oct 2006
    Posts
    221
    is the hitTest code inside the character movieclip then? some of the problem might be that the lines are thin, so its hard to pick up the hitTest.

  19. #19
    Senior Member
    Join Date
    Oct 2006
    Posts
    221
    hmm. i'm stumped here too. i was able to stop character motion when he hit a wall, but its soooo buggy

  20. #20
    Member
    Join Date
    Jul 2006
    Posts
    69
    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 -.-

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center