Ball Paddle Physics

Get help using Construct 2

Post » Fri May 10, 2013 8:24 am

Hey everyone! I am making the classic ball and paddle game. Through-out the whole process I have had issues with stuttering and performance. I eventually rewrote the entire project and went "ape-sh!t" on reducing file sizes and using the best optimization practices. Still, I am having issues.

I notice that other, more intense, games can be played with far better smoothness then mine can. So, I decided to do a test. I stripped everything out and only added one ball, one paddle, and three walls. I added the solids, bullet and physics behaviors where they were needed.

Guess what? Still stuttering....! I really don't understand what can be causing this problem. I must be doing something wrong. Below is my capx file. Thanks for any advice.

.Capx

Decided to compile the above capx file and upload it to my phone for CocoonJS. Stuck at a blank screen.

With console error.
Result of expression 'this.body.SetAwake' [undefined] is not a function.

and Warnings.
Not found getElementByld: c2canvasdivTekniko2013-05-10 08:35:24
B
50
S
14
G
12
Posts: 813
Reputation: 16,764

Post » Fri May 10, 2013 9:41 am

@Tekniko

It stutters a bit in Firefox although shows 60FPS. Chrome is fine though here.

Why have you got a physics behavior on the ball?spongehammer2013-05-10 09:43:21
B
44
S
15
G
9
Posts: 1,096
Reputation: 11,013

Post » Fri May 10, 2013 4:16 pm

No physics behavior? Well, I removed it and the ball still works. In fact most of the shuttering has gone away, although there is still some. I am going to make this change in my main project and see how it runs on a mobile.

EDIT
Well, I removed the physics behavior, on both of my projects, and all of my errors have gone away. There is still some slight stuttering but at least it is now playable. This has even fixed a graphical error introduced with r129 when switching layouts.

And my parents wonder why I dropped out of Computer Programming in college >.< Tekniko2013-05-10 16:28:40
B
50
S
14
G
12
Posts: 813
Reputation: 16,764

Post » Fri May 10, 2013 5:56 pm

@Tekniko

Generally mixing physics with other behaviors which also want to control the object always seems to cause problems. If you need to use physics then only control the object with physics forces.
B
44
S
15
G
9
Posts: 1,096
Reputation: 11,013


Return to How do I....?

Who is online

Users browsing this forum: jul, nicklowkcmagic, Yahoo [Bot] and 17 guests