Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/drbawb/rust-story
/ functions
Functions
86 in github.com/drbawb/rust-story
⨍
Functions
86
◇
Types & classes
31
↓ 32 callers
Method
to_game
(&self)
src/units/drawing.rs:19
↓ 22 callers
Method
to_pixel
(&self)
src/units/drawing.rs:32
↓ 8 callers
Method
get_collision_info
(&self, hitbox: &Rectangle, tile_map: &map::Map)
src/player.rs:354
↓ 8 callers
Method
height
(&self)
src/collisions.rs:32
↓ 8 callers
Method
is_key_held
Responds true if key has been pressed since last call to `beginNewFrame()` but _has not yet been released._ Responds false otherwise.
src/input.rs:68
↓ 8 callers
Method
left
(&self)
src/collisions.rs:26
↓ 8 callers
Method
to_tile
(&self)
src/units/drawing.rs:24
↓ 8 callers
Method
top
(&self)
src/collisions.rs:28
↓ 7 callers
Method
right
(&self)
src/collisions.rs:27
↓ 6 callers
Method
on_ground
The player will collide w/ the ground at y-coord `320` Gravity cannot pull them below this floor.
src/player.rs:647
↓ 6 callers
Method
width
(&self)
src/collisions.rs:31
↓ 5 callers
Method
bottom
(&self)
src/collisions.rs:29
↓ 3 callers
Method
blit_surface
(&self, src: &mut render::Texture, src_rect: &rect::Rect,
src/graphics.rs:84
↓ 3 callers
Method
draw
Draws player to screen
src/player.rs:178
↓ 3 callers
Method
load_image
Loads a bitmap which resides at `file_path` and returns a handle This handle can safely be used in any of the graphics subsystem's rendering contexts.
src/graphics.rs:55
↓ 3 callers
Method
set_looking
This updates the `self.movement` tuple The `Motion` is kept as-is, but the `Facing` portion of the tuple is replaced with `direction`.
src/player.rs:380
↓ 2 callers
Method
bottom_collision
(&self, delta: units::Game)
src/player.rs:634
↓ 2 callers
Method
damage_rectangle
A player's damage rectangle encompasses the whole player.
src/player.rs:561
↓ 2 callers
Method
draw
Draws current state to `display`
src/map.rs:173
↓ 2 callers
Method
is_strobed
(&self)
src/player.rs:585
↓ 2 callers
Method
left_collision
x-axis collision detection
src/player.rs:599
↓ 2 callers
Method
look_horizontal
(&mut self)
src/player.rs:503
↓ 2 callers
Method
right_collision
(&self, delta: units::Game)
src/player.rs:611
↓ 2 callers
Method
set_facing
This updates the `self.movement` tuple The `Motion` is kept as-is, but the `Facing` portion of the tuple is replaced with `direction`.
src/player.rs:372
↓ 2 callers
Method
stop_moving
The player will immediately cease acceleration. They will still be facing the same direction as before this call.
src/player.rs:485
↓ 2 callers
Method
top_collision
y-axis collision detection
src/player.rs:623
↓ 2 callers
Method
was_key_released
Responds true if key was released since last call to `beginNewFrame()`. Responds false otherwise.
src/input.rs:56
↓ 1 callers
Method
begin_new_frame
Resets the toggle states of pressed & released keys.
src/input.rs:27
↓ 1 callers
Method
center_x
(&self)
src/player.rs:594
↓ 1 callers
Method
center_x
(&self)
src/enemies/bat.rs:90
↓ 1 callers
Method
clear_buffer
(&self)
src/graphics.rs:96
↓ 1 callers
Method
collides_with
(&self, other: &Rectangle)
src/collisions.rs:34
↓ 1 callers
Method
current_motion
This is called to update the player's `movement` based on their current: acceleration, velocity, and collision state. Ideally this should be called e
src/player.rs:540
↓ 1 callers
Method
draw
Instructs our actors to draw their current state to the screen.
src/game.rs:168
↓ 1 callers
Method
draw_background
(&mut self, graphics: &graphics::Graphics)
src/map.rs:152
↓ 1 callers
Method
draw_hud
Draws player's HUD if available
src/player.rs:187
↓ 1 callers
Method
draw_sprites
(&mut self, graphics: &graphics::Graphics)
src/map.rs:156
↓ 1 callers
Method
event_loop
Polls current input events & dispatches them to the engine. Then renders a snapshot of the world-state and then waits until its next frame deadline.
src/game.rs:72
↓ 1 callers
Method
get_colliding_tiles
Checks if `Rectangle` is colliding with any tiles in the foreground. NOTE: Checking a Rectangle which would be placed outside the tile-map results in
src/map.rs:211
↓ 1 callers
Method
key_down_event
Handles a key down event
src/input.rs:33
↓ 1 callers
Method
key_up_event
Handles a key up event
src/input.rs:39
↓ 1 callers
Method
load_sprite
Loads a sprite for the selected `movement`, stores it in the player's sprite map. This exhaustively matches all tuples of (Motion,Facing,Looking), tho
src/player.rs:388
↓ 1 callers
Method
load_sprite
(&mut self, display: &mut graphics::Graphics, facing: sprite::Facing)
src/enemies/bat.rs:59
↓ 1 callers
Method
look_down
(&mut self)
src/player.rs:494
↓ 1 callers
Method
look_up
(&mut self)
src/player.rs:489
↓ 1 callers
Method
start
(&mut self)
src/game.rs:63
↓ 1 callers
Method
start_jump
Resets the player's jump timer if they are currently on the ground. Otherwise: uses the remainder of the player's jump timer to extend their jump. Th
src/player.rs:513
↓ 1 callers
Method
start_moving_left
The player will immediately face `West` They will then accelerate at a constant rate in that direction.
src/player.rs:469
↓ 1 callers
Method
start_moving_right
The player will immediately face `East` They will then accelerate at a constant rate in that direction.
src/player.rs:477
↓ 1 callers
Method
stop_jump
A player will immediately cease their jump and become subject to the effects of gravity. While the player is in this state: their remaining `jump tim
src/player.rs:527
↓ 1 callers
Method
switch_buffers
(&self)
src/graphics.rs:92
↓ 1 callers
Method
take_damage
The player takes damage from the world
src/player.rs:571
↓ 1 callers
Method
update
Passes the current time in milliseconds to our underlying actors.
src/game.rs:183
↓ 1 callers
Method
update_x
(&mut self, map: &map::Map)
src/player.rs:227
↓ 1 callers
Method
update_y
(&mut self, map: &map::Map)
src/player.rs:296
↓ 1 callers
Method
was_key_pressed
Responds true if key was pressed since last call to `beginNewFrame()`. Responds false otherwise.
src/input.rs:46
Method
add
(self, rhs: T)
src/units/drawing.rs:40
Method
add
(self, rhs: Millis)
src/units/physics.rs:14
Method
create_test_map
Will initialize a map (20 * 15) tiles: Most of these tiles will be `Air` tiles. There are 15-tile high walls in the first and last columns. A small "
src/map.rs:68
Method
damage_rectangle
(&self)
src/enemies/bat.rs:83
Method
deref
(&'a self)
src/units/physics.rs:42
Method
div
(self, rhs: T)
src/units/drawing.rs:73
Method
div
(self, rhs: Millis)
src/units/physics.rs:137
Method
draw
Repeatedly paints the asset across the entire screen. Moving the destination rectangle `BACKGROUND_SIZE` pixels in either direction as it progresses.
src/backdrop.rs:25
Method
draw
Draws selfs @ coordinates provided by
src/sprite.rs:93
Method
draw
(&mut self, display: &graphics::Graphics)
src/enemies/bat.rs:115
Method
from_sprite
Creates a tile of `tile_type` initialized w/ its optional sprite.
src/map.rs:49
Function
main
()
src/main.rs:16
Method
mul
(self, rhs: T)
src/units/drawing.rs:62
Method
mul
(self, rhs: Millis)
src/units/physics.rs:81
Method
neg
(self)
src/units/physics.rs:49
Method
new
(path: String, graphics: &mut graphics::Graphics)
src/backdrop.rs:17
Method
new
Starts running this games event loop, note that this will block indefinitely. This function will return to the caller when the escape key is pressed.
src/game.rs:36
Method
new
()
src/input.rs:18
Method
new
A new sprite which will draw itself at `coords` `sprite_at` is the index (row) where the sprite starts in `file_name`
src/sprite.rs:62
Method
new
Loads and initializes a set of sprite-sheets for the various combinatoins of directions. (These incl: facing west and east for: standing, walking, jum
src/player.rs:115
Method
new
Prepare the display for rendering
src/graphics.rs:19
Method
new
(width: units::Game, height: units::Game)
src/collisions.rs:19
Method
new
(row: units::Tile, col: units::Tile, tile_type: TileType)
src/map.rs:27
Method
new
(display: &mut graphics::Graphics, x: units::Game, y: units::Game)
src/enemies/bat.rs:37
Method
sub
(self, rhs: T)
src/units/drawing.rs:51
Method
sub
(self, rhs: Millis)
src/units/physics.rs:24
Method
update
(&mut self, _elapsed_time: units::Millis)
src/sprite.rs:108
Method
update
Updates player-state that relies on time data. (Namely physics calculations.) Determines which sprite-sheet should be used for thsi frame. Forwards th
src/player.rs:208
Method
update
no-op for demo map
src/map.rs:192
Method
update
(&mut self, elapsed_time: units::Millis, player_x: units::Game)
src/enemies/bat.rs:94