A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: snake AI

  1. #1
    incredibulus-actionscriptum magnetos's Avatar
    Join Date
    May 2001
    Posts
    2,160

    snake AI

    hello guys i trying to make the snake a little smart here i just started
    www.magnetos.lazoom.com/snake.swf

    use arrokeys to move your snake
    it uses hitTest() so it might get slower as the snake grows
    the code its quite simple i used mad-sci replicating code and i added some simple logic to it

    let me know if the snake is smart enough for ya

  2. #2
    Jordan Berry
    Join Date
    Oct 2002
    Posts
    307
    Cool, i ended up killing myself 15-6
    I'm back.

  3. #3
    2KHeroes / Sylvaniah designer luxregina's Avatar
    Join Date
    Jul 2001
    Location
    Somewhere between Kirlundin and Anskaven
    Posts
    1,273
    Extremly fun ! - i think this could be an interesting renewal of the old snake game ! - snake is pretty easy to beat if you tend to stay in the middle to shorten distance between foods - though, since it got the same speed, it can be the luckiest that wins ( depending on how far from each the next food appears )

    -suggestion : i think you could mix this with a little of the "TRON light-motorcycles" concept : by making the tail of the opponent uncrossable and lethal, you could add some fun/strategic aspect !

  4. #4
    DOT-INVADER marmotte's Avatar
    Join Date
    May 2002
    Location
    Dot-Switzerland
    Posts
    2,601
    nice idea, magnetos ^_^

    really, you don't die when you hit the other snake? aw, i did my best to escape from him everytime

    a complete game with it would be a nice addition... with different (yet simple) backgrounds and a 2 player mode included...

  5. #5
    SaphuA SaphuA's Avatar
    Join Date
    Oct 2002
    Location
    The Netherlands
    Posts
    2,180

    :)

    Hey mag, great to see some nice work of you again

    Realy like this and it can turn out to be a cool game...

    Some sugestions:
    The snake should not have so much random movement (left-right, when the apple is above him)...
    The snake should not immediatly react when a new apple is on screen, it should first move to the center while 'searching' where the apple is...

  6. #6
    incredibulus-actionscriptum magnetos's Avatar
    Join Date
    May 2001
    Posts
    2,160
    thanks guys this was just a test the ai its quite simple
    if applex < snakex dir = left and so on .....
    if sombody want the code let me know

    still its hitTest based so making it more complex would make it slower and slower especialy when the two snake have a big tail

    the only way to go its tile based
    unfortunately dont know enough of it
    perhaps with the proper graphics it could be a nice hand device game
    lile a cell phone or something

    thanks for your suggestions guys you re the best


  7. #7
    Senior Member Mad-Sci's Avatar
    Join Date
    Mar 2000
    Posts
    2,756
    Yea yaa see the real trick is:

    1. you die if you hit your tail or the snakes tail
    2. the snake dies if it hits your tail or itself..

    now that will be way cool..

    tip:
    look one step ahead:
    if you move left and you cannot go left you have 2 choises
    1) go up
    2) go down

    just look for the apple..

    ms

  8. #8
    incredibulus-actionscriptum magnetos's Avatar
    Join Date
    May 2001
    Posts
    2,160
    Originally posted by Mad-Sci
    Yea yaa see the real trick is:

    1. you die if you hit your tail or the snakes tail
    2. the snake dies if it hits your tail or itself..

    now that will be way cool..

    tip:
    look one step ahead:
    if you move left and you cannot go left you have 2 choises
    1) go up
    2) go down

    just look for the apple..

    ms
    thanks for the tips mad

  9. #9
    9 Times the Fun
    Join Date
    Oct 2002
    Location
    Mother Earth
    Posts
    183
    Nice WIP Magnetos,
    Prehaps instead of dieing when you hit the other snake or the wall you could loose points, that way you could also try and increase your score by blocking the other snake - just an idea.

  10. #10
    Who needs pants? hooligan2001's Avatar
    Join Date
    Apr 2001
    Location
    Somewhere
    Posts
    1,976
    nice work mag, keep it up.

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