Creepy-simulation
 
Loading...
Searching...
No Matches
view.view.SimulationView Class Reference

Public Member Functions

 __init__ (self, width=1920, height=1080)
 
 handle_event (self, event)
 
 start_game (self)
 
 draw_background (self)
 
 run (self)
 

Public Attributes

 running_game
 
 width
 
 height
 
 center_x
 
 center_y
 
 screen
 
 clock
 
 manager
 
 image_provider
 
 explodes_drawer
 
 sparkle_drawer
 
 waiting_blocks
 
 blocks
 
 background_image
 
 zoom_level
 
 offset_x
 
 offset_y
 
 dragging
 
 last_mouse_pos
 
 creepers_params
 
 steve_params
 
 thao
 
 radius
 
 last_update_time
 
 will_explodes
 
 will_sparkle
 
 func_type_map
 
 dist_func
 
 ui
 
 parameters
 
 params
 
 simulation
 

Protected Member Functions

 _handle_mouse_button_down (self, event)
 
 _handle_mouse_button_up (self, event)
 
 _handle_mouse_motion (self, event)
 
 _handle_zoom (self, event)
 
 _create_block (self, event)
 
 _handle_ui_event (self, event)
 

Detailed Description

@class SimulationView
@brief Manages the overall simulation view, including rendering and user interactions.

The SimulationView class handles the game loop, rendering of creepers and Steves,
user interactions like zoom and pan, and managing the UI.

Constructor & Destructor Documentation

◆ __init__()

view.view.SimulationView.__init__ (   self,
  width = 1920,
  height = 1080 
)
Initializes a SimulationView object.

@param width: The width of the simulation window.
@param height: The height of the simulation window.

Member Function Documentation

◆ _create_block()

view.view.SimulationView._create_block (   self,
  event 
)
protected

◆ _handle_mouse_button_down()

view.view.SimulationView._handle_mouse_button_down (   self,
  event 
)
protected
Handles user input events such as mouse and UI interactions.

@param event: The pygame event to handle.
@return: False if the event signals to quit, otherwise True.

◆ _handle_mouse_button_up()

view.view.SimulationView._handle_mouse_button_up (   self,
  event 
)
protected
Handles mouse button up events.

@param event: The pygame event for mouse button up.
@return: True if the event is processed.

◆ _handle_mouse_motion()

view.view.SimulationView._handle_mouse_motion (   self,
  event 
)
protected

◆ _handle_ui_event()

view.view.SimulationView._handle_ui_event (   self,
  event 
)
protected

◆ _handle_zoom()

view.view.SimulationView._handle_zoom (   self,
  event 
)
protected

◆ draw_background()

view.view.SimulationView.draw_background (   self)
Draws the background of the simulation view.

◆ handle_event()

view.view.SimulationView.handle_event (   self,
  event 
)

◆ run()

view.view.SimulationView.run (   self)
Runs the main game loop.

◆ start_game()

view.view.SimulationView.start_game (   self)
Starts the game and initializes the simulation.

Member Data Documentation

◆ background_image

view.view.SimulationView.background_image

◆ blocks

view.view.SimulationView.blocks

◆ center_x

view.view.SimulationView.center_x

◆ center_y

view.view.SimulationView.center_y

◆ clock

view.view.SimulationView.clock

◆ creepers_params

view.view.SimulationView.creepers_params

◆ dist_func

view.view.SimulationView.dist_func

◆ dragging

view.view.SimulationView.dragging

◆ explodes_drawer

view.view.SimulationView.explodes_drawer

◆ func_type_map

view.view.SimulationView.func_type_map

◆ height

view.view.SimulationView.height

◆ image_provider

view.view.SimulationView.image_provider

◆ last_mouse_pos

view.view.SimulationView.last_mouse_pos

◆ last_update_time

view.view.SimulationView.last_update_time

◆ manager

view.view.SimulationView.manager

◆ offset_x

view.view.SimulationView.offset_x

◆ offset_y

view.view.SimulationView.offset_y

◆ parameters

view.view.SimulationView.parameters

◆ params

view.view.SimulationView.params

◆ radius

view.view.SimulationView.radius

◆ running_game

view.view.SimulationView.running_game

◆ screen

view.view.SimulationView.screen

◆ simulation

view.view.SimulationView.simulation

◆ sparkle_drawer

view.view.SimulationView.sparkle_drawer

◆ steve_params

view.view.SimulationView.steve_params

◆ thao

view.view.SimulationView.thao

◆ ui

view.view.SimulationView.ui

◆ waiting_blocks

view.view.SimulationView.waiting_blocks

◆ width

view.view.SimulationView.width

◆ will_explodes

view.view.SimulationView.will_explodes

◆ will_sparkle

view.view.SimulationView.will_sparkle

◆ zoom_level

view.view.SimulationView.zoom_level

The documentation for this class was generated from the following file: