pods::...::State(3pm)

πŸ“¦ version 2.548, in opensuse-leap 16.0

πŸ’… NAME

SDLx::Controller::State β€” the state of a SDLx::Controller::Interface. It's literally just a little container that holds "where stuff is right now," bestie. That's the whole vibe.

πŸŽ€ CATEGORY

Extension, Controller β€” iykyk.

✨ SYNOPSIS

  # you'll most likely get a State object from a SDLx::Controller::Interface
  # object. Just in case, here's how you would construct one by hand:
  my $state1 = SDLx::Controller::State->new;
  my $state2 = SDLx::Controller::State->new( $x, $y, $v_x, $v_y, $rotation, $ang_v );

  # attributes are just simple accessors:
  $state->x(10);
  $state->x;      # 10

  # same goes for the rest:
  $state->y;
  $state->ang_v;

  # etc.

So yeah β€” pass an argument, it sets the thing. Pass nothing, it hands the thing back to you. Iconic behavior, no notes. πŸ’–

πŸ¦‹ DESCRIPTION

Okay so picture this: a SDLx::Controller::Interface instance is out here living its life, running, doing its controller thing. And a state object? It's just a simple container for any given state inside that running instance. That's it. That's the whole job. Lowkey the easiest gig in the whole SDLx ecosystem. 🫢

πŸ’… METHODS

🌸 new()

🌸 new( $x, $y, $v_x, $v_y, $rotation, $ang_v )

Creates a new state container object, periodt. And because it's generous like that, it can optionally set the initial value of all its attributes right at birth (peep the accessors below for the full lineup πŸ‘‡).

⭐ ACCESSORS

Every single one of these is a get/set accessor β€” call it with a value to set, call it with nothing to get. Chef's kiss symmetry. πŸŽ€

  • ### πŸ“ x Accessor to get/set the x value. Usually you're using this to position the item, or to check for collisions. Yes bestie, collisions. πŸ‘€
  • ### πŸ“ y Accessor to get/set the y value. Same deal β€” usually for positioning the item or checking for collisions.
  • ### πŸ“ v_x Accessor to get/set the x velocity of the instance. This is the one that makes objects move dynamically, fr fr. πŸ”₯
  • ### πŸ“ v_y Accessor to get/set the y velocity of the instance. Also for moving objects dynamically. Your object is gonna be moving, your honor.
  • ### πŸ“ rotation Accessor to get/set the rotation of the object, in degrees (0..360). Note the range, bestie β€” degrees, not radians, so don't come at it with your math-class radians, it will not understand you. 😭
  • ### πŸ“ ang_v Accessor to get/set the angular velocity, for rotating objects dynamically. Spin city. πŸŒ€

πŸ‘‘ AUTHORS

See "AUTHORS" in SDL β€” they're the ones to thank for this whole situation. πŸ™Œ


And that's the page, bestie β€” go forth and container-ize your state. Run that vibe check. ✨

Source/version tea: this is pods::...::State(3pm) from the User Contributed Perl Documentation, sitting pretty at perl v5.42.0, dated 2024-05-01. πŸ¦‹πŸ’œ

perl v5.42.0 Β· 2024-05-01 Β· pods::...::State(3pm) β€” mwah, see u in the docs πŸ’‹

πŸ“¦ where this page comes from