Login to PixelPAD
Save your project by logging in or signing up.
USERNAME OR EMAIL ADDRESS
PASSWORD
Forgot my Password?
Don't have an account?
Sign Up For PixelPAD
Save your project by logging in or signing up.
EMAIL ADDRESS
PASSWORD
CONFIRM PASSWORD
I already have an account
Sign up as a Teacher
Create classrooms, and monitor your students.
SCHOOL NAME
EMAIL ADDRESS
PASSWORD
CONFIRM PASSWORD
I already have an account
  • 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
Arm Build 2.8.4
Resources
Documentation
Discord
EULA
Privacy Policy
Contact Us
hello@pixelpad.io
© 2023 All Rights Reserved. PixelPAD.io
Region: us-west-1