What does this mean for me? You will always be able to play your favorite games on Kongregate. However, certain site features may suddenly stop working and leave you with a severely degraded experience.
What should I do? We strongly urge all our users to upgrade to modern browsers for a better experience and improved security.
We suggest you install the latest version of one of these browsers:
Kongregate is a community-driven browser games portal with an open platform for all web games.
Get your games in front of thousands of users while monetizing through ads and virtual goods.
Learn more »
Guys, this is the first time I’m posting here on Kongregate (Hello :D).
Today I’ve been working on a personal project, I made a simple pong game, which worked just fine as you can test on ([http://skyxer.com/swf/pong.swf](http://skyxer.com/swf/pong.swf)).
The problem is that I do not know what I did, when I tried to implement the score (I couldn’t get text fields updating properly,after a bit I did get it to work so I saved it) but after saving and debuging the new SWF file, the colisions are all messed up (the result is here [http://skyxer.com/swf/pong2.swf](http://skyxer.com/swf/pong2.swf)).
If you want to check my latest (buggy) source code, do it so here ([http://pastebin.com/GCR53zu2](http://pastebin.com/GCR53zu2)).
Thank you in advance, I can’t figure out what I did, because it was working 20 minutes ago just fine!
Why are you using multiple frames?
Also, are you using CS? Timeline code?
Maybe you have some code other than what you posted; I can’t think of another reason.
Also, on a different note, the vertical bouncing is glitchy; you have to update the ball’s position after multiplying it’s speed, or it stays trapped next to the top or bottom.
> *Originally posted by **[Skyxer](/forums/4/topics/320909?page=1#posts-6755939):***
> It seems if you right click the while the SWF file is playing and you press “Forward” the game will resume and play normally, and it wont occur again!
> My mind is blown… no idea what happened here!
This is what is happening in your case:
If ball.x is \>= than 290 you multiply speed by -1, but as my experience shows as3 is not very precise, your ball.x goes to 291 then you multiply speed by -1 then it goes to 290 then you multiply it again, then 291, then 290….
Instead of multiplyng speed, try changing it like:
ball.x += ballSpeedX;
if(ball.x >= 290)
ballSpeedX = -3;
if(ball.x <= 0)
ballSpeedX = 3;
To explain the game resuming when you press forward: on initiation of the level, you create some variables, and assign a value to them. When your game is stuck, and you reopen that frame, it initiates it, which runs your initiation code. This will reset the ballspeed.