Merge pull request #47 from Ewpratten/assets

map and more assets
This commit is contained in:
Evan Pratten 2021-04-26 18:19:52 -04:00 committed by GitHub
commit 8753436eb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 407 additions and 43 deletions

BIN
assets/audio/shopSong.mp3 Normal file

Binary file not shown.

BIN
assets/audio/swimSong.mp3 Normal file

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,50 @@
{ "frames": {
"pufferFish 0.aseprite": {
"frame": { "x": 0, "y": 0, "w": 39, "h": 25 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 39, "h": 25 },
"sourceSize": { "w": 39, "h": 25 },
"duration": 100
},
"pufferFish 1.aseprite": {
"frame": { "x": 39, "y": 0, "w": 39, "h": 25 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 39, "h": 25 },
"sourceSize": { "w": 39, "h": 25 },
"duration": 100
},
"pufferFish 2.aseprite": {
"frame": { "x": 78, "y": 0, "w": 39, "h": 25 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 39, "h": 25 },
"sourceSize": { "w": 39, "h": 25 },
"duration": 100
},
"pufferFish 3.aseprite": {
"frame": { "x": 117, "y": 0, "w": 39, "h": 25 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 39, "h": 25 },
"sourceSize": { "w": 39, "h": 25 },
"duration": 100
}
},
"meta": {
"app": "http://www.aseprite.org/",
"version": "1.2.27-x64",
"image": "pufferFishAttack.png",
"format": "RGBA8888",
"size": { "w": 156, "h": 25 },
"scale": "1",
"frameTags": [
],
"layers": [
{ "name": "Layer 1", "opacity": 255, "blendMode": "normal" }
],
"slices": [
]
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 974 B

View File

@ -0,0 +1,42 @@
{ "frames": {
"pufferFish 0.aseprite": {
"frame": { "x": 0, "y": 0, "w": 19, "h": 19 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 19, "h": 19 },
"sourceSize": { "w": 19, "h": 19 },
"duration": 100
},
"pufferFish 1.aseprite": {
"frame": { "x": 19, "y": 0, "w": 19, "h": 19 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 19, "h": 19 },
"sourceSize": { "w": 19, "h": 19 },
"duration": 100
},
"pufferFish 2.aseprite": {
"frame": { "x": 38, "y": 0, "w": 19, "h": 19 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 19, "h": 19 },
"sourceSize": { "w": 19, "h": 19 },
"duration": 100
}
},
"meta": {
"app": "http://www.aseprite.org/",
"version": "1.2.27-x64",
"image": "pufferFishBigIdle.png",
"format": "RGBA8888",
"size": { "w": 57, "h": 19 },
"scale": "1",
"frameTags": [
],
"layers": [
{ "name": "Layer 1", "opacity": 255, "blendMode": "normal" }
],
"slices": [
]
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 587 B

View File

@ -0,0 +1,50 @@
{ "frames": {
"pufferFish 0.aseprite": {
"frame": { "x": 0, "y": 0, "w": 19, "h": 19 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 19, "h": 19 },
"sourceSize": { "w": 19, "h": 19 },
"duration": 100
},
"pufferFish 1.aseprite": {
"frame": { "x": 19, "y": 0, "w": 19, "h": 19 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 19, "h": 19 },
"sourceSize": { "w": 19, "h": 19 },
"duration": 100
},
"pufferFish 2.aseprite": {
"frame": { "x": 38, "y": 0, "w": 19, "h": 19 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 19, "h": 19 },
"sourceSize": { "w": 19, "h": 19 },
"duration": 100
},
"pufferFish 3.aseprite": {
"frame": { "x": 57, "y": 0, "w": 19, "h": 19 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 19, "h": 19 },
"sourceSize": { "w": 19, "h": 19 },
"duration": 100
}
},
"meta": {
"app": "http://www.aseprite.org/",
"version": "1.2.27-x64",
"image": "pufferFishExpand.png",
"format": "RGBA8888",
"size": { "w": 76, "h": 19 },
"scale": "1",
"frameTags": [
],
"layers": [
{ "name": "Layer 1", "opacity": 255, "blendMode": "normal" }
],
"slices": [
]
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 768 B

View File

@ -0,0 +1,66 @@
{ "frames": {
"pufferFish 0.aseprite": {
"frame": { "x": 0, "y": 0, "w": 19, "h": 19 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 19, "h": 19 },
"sourceSize": { "w": 19, "h": 19 },
"duration": 100
},
"pufferFish 1.aseprite": {
"frame": { "x": 19, "y": 0, "w": 19, "h": 19 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 19, "h": 19 },
"sourceSize": { "w": 19, "h": 19 },
"duration": 100
},
"pufferFish 2.aseprite": {
"frame": { "x": 38, "y": 0, "w": 19, "h": 19 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 19, "h": 19 },
"sourceSize": { "w": 19, "h": 19 },
"duration": 100
},
"pufferFish 3.aseprite": {
"frame": { "x": 57, "y": 0, "w": 19, "h": 19 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 19, "h": 19 },
"sourceSize": { "w": 19, "h": 19 },
"duration": 100
},
"pufferFish 4.aseprite": {
"frame": { "x": 76, "y": 0, "w": 19, "h": 19 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 19, "h": 19 },
"sourceSize": { "w": 19, "h": 19 },
"duration": 100
},
"pufferFish 5.aseprite": {
"frame": { "x": 95, "y": 0, "w": 19, "h": 19 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 19, "h": 19 },
"sourceSize": { "w": 19, "h": 19 },
"duration": 100
}
},
"meta": {
"app": "http://www.aseprite.org/",
"version": "1.2.27-x64",
"image": "pufferFish.png",
"format": "RGBA8888",
"size": { "w": 114, "h": 19 },
"scale": "1",
"frameTags": [
],
"layers": [
{ "name": "Layer 1", "opacity": 255, "blendMode": "normal" }
],
"slices": [
]
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 420 B

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 292 KiB

After

Width:  |  Height:  |  Size: 323 KiB

File diff suppressed because one or more lines are too long

View File

@ -6,7 +6,7 @@ use crate::{
use raylib::prelude::*;
use serde::{Deserialize, Serialize};
const JELLYFISH_STUN_DURATION: f64 = 0.75;
const JELLYFISH_STUN_DURATION: f64 = 1.5;
const JELLYFISH_STUN_REACH: f32 = 20.0;
#[derive(Debug, Serialize, Deserialize, Default, Clone)]

View File

@ -10,7 +10,7 @@ use raylib::prelude::*;
use serde::{Deserialize, Serialize};
const OCTOPUS_SUCK_AIR_DELAY: f64 = 3.5;
const OCTOPUS_SUCK_AIR_RANGE: f32 = 70.0;
const OCTOPUS_SUCK_AIR_RANGE: f32 = 40.0;
const OCTOPUS_SUCK_AIR_DURATION: f64 = 1.0;
const OCTOPUS_SUCK_AIR_AMOUNT: f32 = 0.1;

View File

@ -32,25 +32,25 @@ impl StunGun {
pub fn lvl1() -> Self {
Self {
range: 30.0,
duration: 0.75,
duration: 2.0,
level: 1,
cost: 30,
cost: 15,
}
}
pub fn lvl2() -> Self {
Self {
range: 60.0,
duration: 1.25,
duration: 2.5,
level: 2,
cost: 40,
cost: 25,
}
}
pub fn lvl3() -> Self {
Self {
range: 80.0,
duration: 1.0,
duration: 3.0,
level: 3,
cost: 50,
cost: 40,
}
}
}
@ -111,14 +111,14 @@ impl AirBag {
Self {
extra_oxygen: 0.15,
level: 1,
cost: 30,
cost: 25,
}
}
pub fn lvl2() -> Self {
Self {
extra_oxygen: 0.30,
level: 2,
cost: 40,
cost: 35,
}
}
pub fn lvl3() -> Self {
@ -186,21 +186,21 @@ impl Flashlight {
Self {
radius: 0.25,
level: 1,
cost: 40,
cost: 20,
}
}
pub fn lvl2() -> Self {
Self {
radius: 0.5,
level: 2,
cost: 50,
cost: 30,
}
}
pub fn lvl3() -> Self {
Self {
radius: 1.0,
level: 3,
cost: 60,
cost: 50,
}
}
}
@ -259,21 +259,21 @@ pub struct Flippers {
impl Flippers {
pub fn lvl1() -> Self {
Self {
speed_increase: 1.2,
speed_increase: 1.1,
level: 1,
cost: 30,
}
}
pub fn lvl2() -> Self {
Self {
speed_increase: 1.5,
speed_increase: 1.2,
level: 2,
cost: 40,
}
}
pub fn lvl3() -> Self {
Self {
speed_increase: 1.8,
speed_increase: 1.3,
level: 3,
cost: 50,
}

View File

@ -39,3 +39,10 @@ impl std::ops::Deref for AudioPlayer {
&self.backend
}
}
impl std::ops::DerefMut for AudioPlayer {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.backend
}
}

View File

@ -1,6 +1,7 @@
use raylib::core::audio::RaylibAudio;
use raylib::prelude::*;
use crate::gamecore::GameCore;
use crate::{gamecore::GameCore, lib::wrappers::audio::player::AudioPlayer};
const NORMAL_PLAYER_SPEED: i32 = 1;
const BOOST_PLAYER_SPEED: i32 = NORMAL_PLAYER_SPEED * 2;
@ -11,14 +12,19 @@ const BOOST_DECREASE_PER_SECOND: f32 = 0.65;
const BOOST_REGEN_PER_SECOND: f32 = 0.25;
const BREATH_DECREASE_PER_SECOND: f32 = 0.02;
pub fn update_player_movement(
draw_handle: &mut RaylibDrawHandle,
game_core: &mut GameCore,
window_center: Vector2,
) {
// let mut p: AudioPlayer = AudioPlayer::new(RaylibAudio::init_audio_device());
// p.play_sound(&game_core.resources.breath);
// Calculate DT
let dt = draw_handle.get_time() - game_core.last_frame_time;
// Handle player movement
let mouse_pose = draw_handle.get_mouse_position();
let mouse_world_pose = draw_handle.get_screen_to_world2D(mouse_pose, game_core.master_camera);
@ -80,6 +86,7 @@ pub fn update_player_movement(
game_core
.player
.begin_attack(&mut game_core.world, draw_handle.get_time());
println!("{{\"x\":{}, \"y\":{}}},",f32::round(game_core.player.position.x),f32::round(game_core.player.position.y));
}
// Move the player in their direction

View File

@ -123,9 +123,9 @@ impl Screen for PauseMenuScreen {
// Render credits
draw_handle.draw_text(
"Credits:\n\t- @ewpratten\n\t- @rsninja722\n\t- @wm-c\n\t- @catarinaburghi",
"Credits:\n\t- @ewpratten\n\t- @rsninja722\n\t- @wm-c\n\t- @catarinaburghi\n\t- @kondroel",
(win_width / 2) - (SCREEN_PANEL_SIZE.x as i32 / 2) + 10,
(win_height / 2) - (SCREEN_PANEL_SIZE.y as i32 / 2) + 170,
(win_height / 2) - (SCREEN_PANEL_SIZE.y as i32 / 2) + 150,
20,
Color::BLACK,
);

View File

@ -1,9 +1,4 @@
use raylib::{
math::Vector2,
shaders::Shader,
texture::{Image, RenderTexture2D, Texture2D},
RaylibHandle, RaylibThread,
};
use raylib::{RaylibHandle, RaylibThread, audio::Sound, math::Vector2, shaders::Shader, texture::{Image, RenderTexture2D, Texture2D}};
use crate::lib::wrappers::animation::FrameAnimationWrapper;
@ -62,6 +57,9 @@ pub struct GlobalResources {
// Treasure
pub transponder: FrameAnimationWrapper,
// Audio
pub breath: Sound,
}
impl GlobalResources {
@ -155,7 +153,7 @@ impl GlobalResources {
)?,
Vector2 { x: 20.0, y: 20.0 },
15,
4,
6,
),
octopus_animation_regular: FrameAnimationWrapper::new(
raylib.load_texture_from_image(
@ -257,6 +255,7 @@ impl GlobalResources {
4,
4,
),
breath: Sound::load_sound("./assets/audio/breath.mp3")?
})
}
}