Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Troubleshoot help

edited July 2013 in General Posts: 3

I am just starting to try and learn codea and I wrote this code and every time I run it it comes up with an error that says
Error :7: attempt to perform arithmetic on global value 'rect_height' if someone could show me where my mistake is and how to find them in the future that would be amazing
I believe the mistake is in this general area

function setup()


p_rect = physics.body(POLYGON,
                    vec2(-rect_width / 2, -rect_height / 2),
                    vec2(-rect_width / 2, rect_height / 2),
                    vec2(rect_width / 2, rect_height / 2),
                    vec2(rect_width / 2, -rect_height / 2)
p_rect.x = math.random(60,250)
p_rect.y = math.random(60,250)
p_rect.gravityScale = 0
p_rect.restitution = 1


  • Jmv38Jmv38 Mod
    Posts: 3,295

    What about.
    Instead of.

Sign In or Register to comment.