A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: [beta] and [help] of space shooter

  1. #1
    Senior Member mandissected's Avatar
    Join Date
    Jan 2005
    Location
    Berwick - England
    Posts
    338

    [beta] and [help] of space shooter

    ok this is my second game (and my 3rd attempt at it since i seem to have a habit of accidentally deleting the files from time to time) and i just want some feedback on it. i will be adding a bit of a story, more levels or difficulty levels and a high score table. any improvements you guys suggest will be appreciated.

    game

    as for the help, i can't figure out how to reset the speed of rocks when you restart a game. I use clearInterval to reset the ships speed which works fine, but since there are multiple rocks which all have setInterval from the same function I can't figure out how to get the clearInterval to work for them.

    Anyone got any ideas on how to fix this?

    Thanks

  2. #2
    I tried... dbarbarian's Avatar
    Join Date
    Aug 2003
    Location
    Berkeley, California, USA
    Posts
    678
    This is a very good attempt for a second game.

    Some things to help:
    I'm not sure how you are doing the collision, but it seems that you are using the hiTest function. That is fine, but with a slow paced game like this where collision is very important, i would recommend a more complex collision detection (one of those vector things that I dont even understand) or just make the ship more like circle. This wont make the hitTest perfect (not even close for that matter) but it still reduces the amount of empty space that seems to collide with the asteroids. I know that you want to make it look like the original asteroids, but compromise is necessary. Either that, or make the asteroids/Ship smaller to make it less obvious ( )
    I would also make the control a bit more responsive, not sure how you're doing it, but maybe detecting the keyPress inside a enterFrame would be better.

    I am not quite sure what you are asking about the setInterval for the speed of the asteroids.

    Edit: Nvm, you are detecting the keypress inside an enterFrame. Maybe increasing the frame rate will help. I suggest 25 fps.
    Last edited by dbarbarian; 06-01-2005 at 01:59 PM.

  3. #3
    better than chuck norris
    Join Date
    Jun 2004
    Location
    West Coast of Michigan
    Posts
    667
    look into the collision of circles. use that for the asteroids.

    raise the framerate to 25-30 for this arcade game.

  4. #4
    Senior Member mandissected's Avatar
    Join Date
    Jan 2005
    Location
    Berwick - England
    Posts
    338
    Ok, so I've updated some of the bugs. I couldn't find a tutorial on the complext hitTest so I stuck with the basic one, tweaking it and making the ship smaller. I've put the frame rate up to 30fps so hopefully it's a bit smoother for you guys. I still have the problem with rock speed I mentioned earlier. You only notice it if you keep replaying after dying or completing the game. the rocks just keep getting faster.

    Scoring is also there so next step is a high score table, I've now changed it so you get a time bonus when you complete it quicker. I think it makes it a bit mor addicting, what do you guys think?

    As well as the highscore table I'm going to be adding different difficulties although I haven't decided if these should be preset or you can choose the number of asteroids yourself. Any suggestions?

    Thanks everyone who takes the time out to play the game and/or leave comments.

  5. #5
    better than chuck norris
    Join Date
    Jun 2004
    Location
    West Coast of Michigan
    Posts
    667
    i dig it.
    but i didnt see the bug you mentioned.
    if they keep on speeding up, maybe you're not resetting the variables?
    it would be way cool to see this game changed into more of an upgrading game, where the levels get harder and harder, and then when you beat a level you get cash or something to spend on better weapons, sheilds, speed.

    o yeah, what about teleportation?

    btw, circle collision is easy, as long as youve taken basic geometry, you know pythagorean theorem: (a^2+b^2=c^2). just use that, and if c is less than the radius of circle one + radius of circle 2, then they collide.

    hope that helps.

  6. #6
    Half Empty happinessSam's Avatar
    Join Date
    May 2003
    Location
    London
    Posts
    442
    Yeah, for a second attempt at a game this is really good.
    I did notice the speed up bug. This is probably because you're not clearing all your intervals when the game is finished.

    Can I ask why you're using setInterval? It has it's uses but for this type of game I'm fairly sure you'd be better off with onEnterFrame.

  7. #7
    Senior Member mandissected's Avatar
    Join Date
    Jan 2005
    Location
    Berwick - England
    Posts
    338
    Thanks for the positive feedback guys, it really helps as I'm starting to get a little down know I'm coming across more problems but I'm prepared to slog through it.

    Santuria - those levels sound like a pretty good idea but don't you think it would get a bit dull after only a few levels? I was thinking about setting up a dog fight type scenario with an enemy that includes some random teleportation. After all if you go off the top and appear at the bottom why can't you teleport? thanks for the tip on circle collision, I'll have a play around and see if it improves the hitTest.

    hapinessSam - yeah, I'm can't seem to clear the variables, I've tried a few ways but so far no luck. I'm using setInterval because it's the only way I know at the moment. The game was originally from a tutorial in a magazine but half the code didn't work and half of it was missing so I've had to learn a lot more than I expected

  8. #8
    I tried... dbarbarian's Avatar
    Join Date
    Aug 2003
    Location
    Berkeley, California, USA
    Posts
    678
    The easiest way is to create a movie clip empty movie clip. On this movie clip, you will put the onEnterFrame actions. So instead of using a interval, the function is called every frame. That is why i recommended increasing the fps to make the movement less chopy, but i didnt realize that you were using setInterval for all the movements.
    code:
     onClipEvent(enterFrame) {
    //code goes here
    }


  9. #9
    Senior Member mandissected's Avatar
    Join Date
    Jan 2005
    Location
    Berwick - England
    Posts
    338
    thanks for the tip dbarbarian but I've got the clearInterval working now (thanks to some help in the actionscript forum). All I've got to do is get the high score working, add some sound and difficulty levels and then the games ready for release. If people like it I might add more levels but I'm not too sure about that.

    All feedback is greatly appreciated by anyone who plays the game.

    Thanks

  10. #10
    Senior Member mandissected's Avatar
    Join Date
    Jan 2005
    Location
    Berwick - England
    Posts
    338
    Ok, so now you can select how many rocks are on screen from 1 to 6 to add a little more variety, I've got one bad sound that annoys the hell out of me but i was hoping to get some feedback on what other people thought. please.

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