A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: [Beta]: Trying to create first game ever..having bugs

  1. #1
    Junior Member
    Join Date
    Mar 2002
    Posts
    27

    [Beta]: Trying to create first game ever..having bugs

    I guess this isn't really a 'Beta'. I wouldn't go around and start showing people yet unless I thought they could give some help.

    For one, if you play the .swf file I've included at the bottom of my post, you will notice how buggy the walls are. When the ball bounces and hits a wall, it bounces back at the same exact angle. If I set the _x, and _y to be 0; and the x/yspeed both to 0 then the ball goes right through the lines for some reason. I don't know if it would be better to have the ball bounce at a more realistic angle or to not have any bounce at all.

    If there is no bounce then the ball tends to get stuck in the wall and very slowly passes through. I've looked up a whole lot of tutorials on making a ball bounce, but none of them worked on my ball. The only effect I ever saw was that the ball would be completely unmovable.

    I know the game stinks, but I have ideas for it and don't want to continue making new levels or cleaning it up until I get these walls figured out. The .swf is the first link, the second link is the .fla file so you can see what my code looks like.

    Remember, this is just my first game and I only started learning actionscript about a week ago so try not to be too judgemental. Any help/advise not related to the wall is also welcome.

    Thanks!
    TG.

    http://files.filefront.com/ballmazeb.../fileinfo.html <--swf

    http://files.filefront.com/ballmazeb.../fileinfo.html <--fla

  2. #2
    Senior Member Dricciotti's Avatar
    Join Date
    Aug 2002
    Posts
    2,988
    moved

  3. #3
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    what is you collision method,- do you use data like arrays to define where a wall is- or is it by some people called "art based" meaning you just check collision by hitTest ?

  4. #4
    Junior Member
    Join Date
    Mar 2002
    Posts
    27
    i suppose it would be "art based" but that is only cus it is the way all the tutorials I read showed. Should I check into arrays? Do you think it would be more definitive or whatever?


    Thanks Dricciotti for moving this for me =)

  5. #5
    M.D. mr_malee's Avatar
    Join Date
    Dec 2002
    Location
    Shelter
    Posts
    4,139
    the art based method your using isn't very efficent at all, your checking individual hitTests against all wall segments, use one movieclip for the walls and do a shapeflag hitTest
    lather yourself up with soap - soap arcade

  6. #6
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    I personally haven´t worked that much in the past with hitTest methods simply because I cant predict enough out of them. One main problem is to always to check a hypothetic collision (but it doesn´t actually yet occour) but hittest only works if the symbol is in contact with the other shape so either way you´d have to move it back to where it came from or use a fake symbol that does the hypothetic collision for you and gives the answer.
    The reason I tell you this is because I think that your hypothetic collision is not correct otherwise you would set the symbol correctly back to where it cam from or atlest to the closest distance to the collision-symbol. This only happens if the hypothetical collision turns out to be true (it would collide) and thus move back or reflect as in your game.

    The other thing is that with hitTest you practicly know hardly anything (like I already introduced) you dont know how the shape is like- it´s like beeing in a dark room and knowing only that you hit some wall but not from where and how. So it means that reflecting is almost impossible with this because you´d need to know in what direction to reflect the bounce (based on the direction of the wall).

    so using arrays and that way a grid matrix for the collision checking could solve the bounce thingy

  7. #7
    Truimagz.com everfornever's Avatar
    Join Date
    Sep 2006
    Location
    St. Louis
    Posts
    1,306
    (dont flame me)

    But I thought this might help the OP, you can unlimitedly upload stuff here, with no sign in or anything. instead of having to make people download your stuff. It's fast and I am sure it will come in handy as you test more and more stuff online.

    http://www.creativededication.com

    As to your post now.

    Here are some great tutorial sites that also might help you to learn about hitTests and such.

    http://www.truimagz.com/forum/viewfo...6e24dcdd14f0dc

    http://www.kirupa.com
    http://www.tutorialized.com/tutorials/Flash/1

    Good luck to you, and I hope you found my links usefull
    Last edited by everfornever; 02-25-2007 at 09:25 PM.

  8. #8
    Junior Member
    Join Date
    Mar 2002
    Posts
    27
    Thanks everyone for your responses.

    I'm going to look into arrays/shapeflag hitTest now. Are there any specific tutorials that you guys found/find useful for these?

    The reason why I didn't start building more into my game is cus I knew there had to be a way to do the walls in an easier way than to right the hitTest for each individual wall.

    everfornever: thanks for that link to uploading flash files. I was looking for something like that but didn't really know what to use so I just used fileplanet since I have an account already. I'll check the other links after dinner. (P.S. I used to live in Davie ;-) )

    Thanks again guys

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