• DOCS
  • EXPLORE
  • LEARN
  • LIBRARY
  • LOGIN
  • Introduction
  • Game
  • Start-loop
  • Objects
  • Sprites
  • Animation
  • Sounds
  • Rooms
  • Input
  • Collision
  • Functions
  • Camera
  • Fps
  • Text
  • Filters
  • Multiplayer
  • Legacy

PixelPAD 2D - start-loop

start/loop

Example
Description
In order to access variables in both the start and the loop of an object, you need to declare variables using the self parameter. To understand why, you must understand how Python objects are created within PixelPAD. Every PixelPAD object has default functions, start() and loop(). These functions are just visually represented by the start and loop tabs for convenience. In Python, any variable declared within any function belongs only to that function. So, if you wanted to use a variable across different functions, like in the case of using a variable across start() or loop(), you must declare that this variable belongs to the class by using the self. parameter.
Parameters
self.variable
Declares the variable belongs to the class, and can be accessed in both the start and the loop scripts.

Return
The variable used in both the start and loop
PixelPAD
About Us
Discord
Arm Build 3.0.478
Resources
Documentation
EULA
Privacy Policy
Contact Us
hello@pixelpad.io
© 2026 All Rights Reserved.
PixelPAD.io
Logo

Welcome Back!

Log in to continue creating

Save your project by logging in or signing up.
Forgot Password?

Don't have an account?

Logo

Create Your Account

Join thousands of creators on PixelPad

Save your project by logging in or signing up.

Already have an account? Log in

Logo

Join as an Educator

Empower your students with creative tools

Create classrooms and monitor your students' progress.

Already have an account? Log in