A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 40

Thread: Grand Theft Flash

  1. #1
    Mr.Hamburger
    Join Date
    Feb 2007
    Posts
    5

    Grand Theft Flash

    Hi everyone, I am developing a game called Grand Theft Flash and I want to make it so my character can get in and out of cars. I have search Google and I couldn't find anything, please help.

  2. #2
    Script kiddie VENGEANCE MX's Avatar
    Join Date
    Jun 2004
    Location
    England
    Posts
    2,590
    Hahaha.



    Seriously, that's the least of your worries. You won't finish this game if you can't do that.
    http://www.birchlabs.co.uk/
    You know you want to.

  3. #3
    M.D. mr_malee's Avatar
    Join Date
    Dec 2002
    Location
    Shelter
    Posts
    4,139
    Quote Originally Posted by that one guy
    I have search Google and I couldn't find anything, please help.
    weird http://www.google.com.au/search?hl=e...G=Search&meta=
    lather yourself up with soap - soap arcade

  4. #4
    Mr.Hamburger
    Join Date
    Feb 2007
    Posts
    5
    Quote Originally Posted by mr_malee
    Ya...I dont know if you know this but that is way different then what I am looking for....(EDIT) Oh, I see what you mean...Ya, I already know how to do that, but how do I swap symbols so the guy turns into the car? I found a tutorial a while back but now I cant find it.
    Last edited by that one guy; 02-18-2007 at 09:55 PM.

  5. #5
    Always Twirling Toward Freedom pooon's Avatar
    Join Date
    Oct 2001
    Location
    On the sunny beaches of Canada
    Posts
    896
    Take it one step at a time. You should be asking how to make a character walk, then make a car drive. By that time you should be able to figure out how to get him in and out of the car.

  6. #6
    Mr.Hamburger
    Join Date
    Feb 2007
    Posts
    5
    Quote Originally Posted by pooon
    Take it one step at a time. You should be asking how to make a character walk, then make a car drive. By that time you should be able to figure out how to get him in and out of the car.
    I know how to make a character walk and how to make a car drive Mr.inner piece. I need to find out how to swap movieclips.

  7. #7
    M.D. mr_malee's Avatar
    Join Date
    Dec 2002
    Location
    Shelter
    Posts
    4,139
    you can't swap movieclips, think about it as swapping control

    if(player.type == man) controlMan(player)

    if(player.type == car) controlCar(player)

    when the player attempts to get into a car, remove the player movieclip, playerClip.removeMovieClip()

    when the player wants to exit, re-attach the movieclip
    playerClip = attachMovie("playerClip", "playerClip", depth)

    read up on attachMovie, swapDepths and removeMovieClip
    lather yourself up with soap - soap arcade

  8. #8
    Mr.Hamburger
    Join Date
    Feb 2007
    Posts
    5
    Quote Originally Posted by mr_malee
    you can't swap movieclips, think about it as swapping control

    if(player.type == man) controlMan(player)

    if(player.type == car) controlCar(player)

    when the player attempts to get into a car, remove the player movieclip, playerClip.removeMovieClip()

    when the player wants to exit, re-attach the movieclip
    playerClip = attachMovie("playerClip", "playerClip", depth)

    read up on attachMovie, swapDepths and removeMovieClip
    I dont know where to put that script though...I a fairly new with flash. Would I put if(player.type == man) controlMan(player) and

    if(player.type == car) controlCar(player) in the frame actions? And then put the playerClip.removeMovieClip() as a hittest on the car so when the man walks over the car the man movie clip will delete?

  9. #9
    M.D. mr_malee's Avatar
    Join Date
    Dec 2002
    Location
    Shelter
    Posts
    4,139
    the best way to go about this would be classes. Creating the player as a class which contains different control methods, you then switch between different controls within this class

    but since you don't knwo if these should be frame actions or not, classes might be out of reach, as with your game idea, but anyway, here's the easy way

    main timeline:

    player is an object

    Code:
    var player = new Object()
    
    player.type = "Man"
    player.vx = 0
    player.vy = 0
    player.x = 0
    player.y = 0
    player.clip = _root.attachMovie("player", "playerClip", 1)
    
    function controlMan(){
    
    //key movement
    if(Key.isDown(Key.RIGHT)) player.vx = 5;
    
    //get into car
    if(Key.isDown(Key.SPACE)){
    
    if(player.clip.hitTest(car)){
    
    player.x = car._x
    player.y = car._y
    player.clip.removeMovieClip()
    player.clip = car
    player.type = "Car"
    
    }
    }
    
    function controlCar(){
    
    //get out
    if(Key.isDown(Key.SPACE)){
    
    player.clip = _root.attachMovie("player", "playerClip", 1)
    player.type = "Man"
    }
    
    //movement
    
    player.vx = speed * Math.cos(angle)
    player.vy = speed * Math.sin(angle)
    }
    
    function renderPlayer(){
    
    player.x += player.vx
    player.y += player.vy
    
    player.clip._x = player.x
    player.clip._y = player.y
    }
    
    onEnterFrame = function(){
    
    _root["control"+player.type]()
    
    renderPlayer()
    }
    you say your fairly new with flash, why are you trying to do a GTA game?
    Last edited by mr_malee; 02-18-2007 at 10:57 PM.
    lather yourself up with soap - soap arcade

  10. #10
    Mr.Hamburger
    Join Date
    Feb 2007
    Posts
    5
    Quote Originally Posted by mr_malee
    the best way to go about this would be classes. Creating the player as a class which contains different control methods, you then switch between different controls within this class

    but since you don't knwo if these should be frame actions or not, classes might be out of reach, as with your game idea, but anyway, here's the easy way

    main timeline:

    player is an object

    Code:
    var player = new Object()
    
    player.type = "Man"
    player.vx = 0
    player.vy = 0
    player.x = 0
    player.y = 0
    player.clip = _root.attachMovie("player", "playerClip", 1)
    
    function controlMan(){
    
    //key movement
    if(Key.isDown(Key.RIGHT)) player.vx = 5;
    
    //get into car
    if(Key.isDown(Key.SPACE)){
    
    if(player.clip.hitTest(car)){
    
    player.x = car._x
    player.y = car._y
    player.clip.removeMovieClip()
    player.clip = car
    player.type = "Car"
    
    }
    }
    
    function controlCar(){
    
    //get out
    if(Key.isDown(Key.SPACE)){
    
    player.clip = _root.attachMovie("player", "playerClip", 1)
    player.type = "Man"
    }
    
    //movement
    
    player.vx = speed * Math.cos(angle)
    player.vy = speed * Math.sin(angle)
    }
    
    function renderPlayer(){
    
    player.x += player.vx
    player.y += player.vy
    
    player.clip._x = player.x
    player.clip._y = player.y
    }
    
    onEnterFrame = function(){
    
    _root["control"+player.type]()
    
    renderPlayer()
    }
    you say your fairly new with flash, why are you trying to do a GTA game?
    Cool thanks.

  11. #11
    Knows where you live
    Join Date
    Oct 2004
    Posts
    944
    Just because you know where you can find a code to copy and paste, doesn't mean you know how to do it...

    This scale of project is clearly beyond your current knowledge. Start with something a bit simpler and code it yourself.
    The greatest pleasure in life is doing what people say you cannot do.
    - Walter Bagehot
    The height of cleverness is to be able to conceal it.
    - Francois de La Rochefoucauld

  12. #12
    M.D. mr_malee's Avatar
    Join Date
    Dec 2002
    Location
    Shelter
    Posts
    4,139
    it will not suprise me if theres a thread later about car movement
    lather yourself up with soap - soap arcade

  13. #13
    Truimagz.com everfornever's Avatar
    Join Date
    Sep 2006
    Location
    St. Louis
    Posts
    1,306
    everyone wants to make a WOW clone or Grand theft auto...............

    The funny part about it, is that the people who actually could dont.

    That should tell you something.

  14. #14
    Zombie Coder EvilKris's Avatar
    Join Date
    Jun 2006
    Location
    Fukuoka, Japan.
    Posts
    796
    You can go ahead and check out the GTA prototype on my blog (click on the banner below). Feel free to decompile/analyse. Just don't e-mail me questions about it after, lol.

    My advice. Be realistic. GTA in Flash? Not a chance in hell. That is NOT a single man project.

  15. #15
    Truimagz.com everfornever's Avatar
    Join Date
    Sep 2006
    Location
    St. Louis
    Posts
    1,306
    well and unless your using a 3d program to make your stuff, and the graphics are the bomb, its gunna suck in that genre.

    those games are supposed to be 3d,thats why gta1 (top down) was ok, but the 3d one they made like 10 versions of and have on every system now.

    Think about that.

  16. #16
    Senior Member
    Join Date
    Nov 2006
    Posts
    196
    Well gta isnt that hard to make the hardest bit would be api but as ever said you will never make the gta game 3d in flash. Top down view is very easy but you will proberly have troble with the AI. Im making a gta like game at the moment and Iv got the Peoples AI and car movement up and running in just 1 hour =).

  17. #17
    M.D. mr_malee's Avatar
    Join Date
    Dec 2002
    Location
    Shelter
    Posts
    4,139
    Quote Originally Posted by this.Alex
    Well gta isnt that hard to make
    hmmmmm

    Quote Originally Posted by this.Alex
    Top down view is very easy but you will proberly have troble with the AI.
    hmmmmm

    Quote Originally Posted by this.Alex
    Im making a gta like game at the moment and Iv got the Peoples AI and car movement up and running in just 1 hour =).
    hmmmmm
    lather yourself up with soap - soap arcade

  18. #18
    Knows where you live
    Join Date
    Oct 2004
    Posts
    944
    Quote Originally Posted by this.Alex
    Well gta isnt that hard to make the hardest bit would be api but as ever said you will never make the gta game 3d in flash. Top down view is very easy but you will proberly have troble with the AI. Im making a gta like game at the moment and Iv got the Peoples AI and car movement up and running in just 1 hour =).
    I highly doubt you truely understand what you just said.
    The greatest pleasure in life is doing what people say you cannot do.
    - Walter Bagehot
    The height of cleverness is to be able to conceal it.
    - Francois de La Rochefoucauld

  19. #19
    Im making a gta like game at the moment and Iv got the Peoples AI and car movement up and running in just 1 hour =).
    Wow, I would like to see a demo. Sounds like u got some secret coding that we don't know about!

  20. #20
    Zombie Coder EvilKris's Avatar
    Join Date
    Jun 2006
    Location
    Fukuoka, Japan.
    Posts
    796
    Im making a gta like game at the moment and Iv got the Peoples AI and car movement up and running in just 1 hour =).
    Lol.. spot the arrogant noob. Sorry but:

    if(player x < this._x)
    this._x--;

    -will not cut it for a GTA game.

    Please, post the fla grandmaster Flash.

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