Add minigun and replace gun images with much better ones.
5
CREDITS
@@ -1,7 +1,10 @@
|
|||||||
Thanks to OpenGameArt and:
|
Thanks to OpenGameArt and:
|
||||||
Kay Lousberg for the 2d Guns assets: https://opengameart.org/content/2d-guns
|
|
||||||
2D_Platformerguy for the music: https://opengameart.org/content/electronic-music-chiptune-3
|
2D_Platformerguy for the music: https://opengameart.org/content/electronic-music-chiptune-3
|
||||||
TinyWorlds for the death sound effect: https://opengameart.org/content/explosion-0
|
TinyWorlds for the death sound effect: https://opengameart.org/content/explosion-0
|
||||||
|
|
||||||
|
The gun icons used in this project are from game-icons.net.
|
||||||
|
Licensed under the Creative Commons Attribution 3.0 International License (CC BY 3.0): https://creativecommons.org/licenses/by/3.0/
|
||||||
|
|
||||||
Huge Thanks to Python for being the programming language used in this game.
|
Huge Thanks to Python for being the programming language used in this game.
|
||||||
https://www.python.org/
|
https://www.python.org/
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 4.0 KiB |
BIN
assets/graphics/minigun.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 0 B |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 4.1 KiB |
@@ -1,7 +1,7 @@
|
|||||||
from ursina import Entity, Quad, color, camera, held_keys, destroy
|
from ursina import Entity, Quad, color, camera, held_keys, destroy
|
||||||
|
|
||||||
class Inventory():
|
class Inventory():
|
||||||
def __init__(self, x=0, y=4.5, width=12, height=1, slots=5):
|
def __init__(self, x=0, y=4.5, width=1.2, height=0.1, slots=5):
|
||||||
self.width = width
|
self.width = width
|
||||||
self.height = height
|
self.height = height
|
||||||
self.x = x
|
self.x = x
|
||||||
@@ -32,9 +32,9 @@ class Inventory():
|
|||||||
if key.isnumeric() and int(key) <= self.slot_number:
|
if key.isnumeric() and int(key) <= self.slot_number:
|
||||||
self.switch_to(int(key) - 1)
|
self.switch_to(int(key) - 1)
|
||||||
|
|
||||||
if key == "scroll up":
|
if key == "scroll down":
|
||||||
self.switch_to(min(self.slot_number - 1, self.current_slot + 1))
|
self.switch_to(min(self.slot_number - 1, self.current_slot + 1))
|
||||||
elif key == "scroll down":
|
elif key == "scroll up":
|
||||||
self.switch_to(max(0, self.current_slot - 1))
|
self.switch_to(max(0, self.current_slot - 1))
|
||||||
|
|
||||||
def create_grid(self):
|
def create_grid(self):
|
||||||
@@ -43,9 +43,9 @@ class Inventory():
|
|||||||
parent = camera.ui,
|
parent = camera.ui,
|
||||||
model = Quad(radius=.015),
|
model = Quad(radius=.015),
|
||||||
texture = 'white_cube',
|
texture = 'white_cube',
|
||||||
scale = (self.slot_width * 0.1, self.height * 0.1),
|
scale = (self.slot_width, self.height),
|
||||||
origin = (-slot * (self.slot_width / 2), 0),
|
origin = (-slot * (self.slot_width * 7), 0),
|
||||||
position = (-.55, -.4),
|
position = (-.7, -.4),
|
||||||
color = color.gray if slot != self.current_slot else color.white
|
color = color.gray if slot != self.current_slot else color.white
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -56,9 +56,9 @@ class Inventory():
|
|||||||
parent = camera.ui,
|
parent = camera.ui,
|
||||||
model = Quad(radius=.015),
|
model = Quad(radius=.015),
|
||||||
texture = item,
|
texture = item,
|
||||||
scale = (self.slot_width * 0.1, self.height * 0.1),
|
scale = (self.slot_width, self.height),
|
||||||
origin = (-slot * (self.slot_width / 2), 0),
|
origin = (-slot * (self.slot_width * 7), 0),
|
||||||
position = (-.55, -.4),
|
position = (-.7, -.4),
|
||||||
z=-1,
|
z=-1,
|
||||||
color = color.gray if slot != self.current_slot else color.white
|
color = color.gray if slot != self.current_slot else color.white
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ enemy_health = 100
|
|||||||
weapons = {
|
weapons = {
|
||||||
"assault_rifle": {"dmg": 20, "atk_speed": 0.2, "image": "assets/graphics/assaultrifle.png"},
|
"assault_rifle": {"dmg": 20, "atk_speed": 0.2, "image": "assets/graphics/assaultrifle.png"},
|
||||||
"smg": {"dmg": 10, "atk_speed": 0.1, "image": "assets/graphics/smg.png"},
|
"smg": {"dmg": 10, "atk_speed": 0.1, "image": "assets/graphics/smg.png"},
|
||||||
|
"minigun": {"dmg": 2, "atk_speed": 0.02, "image": "assets/graphics/minigun.png"},
|
||||||
"pistol": {"dmg": 100 / 3, "atk_speed": 1 / 3, "image": "assets/graphics/pistol.png"},
|
"pistol": {"dmg": 100 / 3, "atk_speed": 1 / 3, "image": "assets/graphics/pistol.png"},
|
||||||
"revolver": {"dmg": 50, "atk_speed": 1 / 2, "image": "assets/graphics/revolver.png"},
|
"revolver": {"dmg": 50, "atk_speed": 1 / 2, "image": "assets/graphics/revolver.png"},
|
||||||
"sniper": {"dmg": 100, "atk_speed": 1, "image": "assets/graphics/sniper.png"},
|
"sniper": {"dmg": 100, "atk_speed": 1, "image": "assets/graphics/sniper.png"},
|
||||||
|
|||||||