Skip to content

Commit

Permalink
Merge pull request #65 from chumpatrol1/dev
Browse files Browse the repository at this point in the history
Update to V18
  • Loading branch information
chumpatrol1 committed Aug 6, 2023
2 parents 7a30339 + 4f851f2 commit bd1682c
Show file tree
Hide file tree
Showing 49 changed files with 1,004 additions and 209 deletions.
18 changes: 8 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# blob_ball
Slime Soccer type game

**v0.17.1b**
**v0.18.0b**


**Features:**
* Casual Matches!
* 15 of the exact same blob!
* 20 unique blobs!
* 13 of the exact same blob!
* 21 unique blobs!
* Physics system that works 99.99% of the time!
* High Octane Matches!
* Lots of advanced tech!
Expand Down Expand Up @@ -42,10 +42,8 @@ Slime Soccer type game


**Changelog**
* Added Joker Blob
* Added Taco Blob
* Added Cactus Blob
* Added Merchant Blob
* Balanced a large chunk of the cast
* Default ruleset changed to have 10 goals and longer match timer
* Fixed various bugs
* Added Bubble Blob
* Optimized Environmental Modifiers like Glue etc.
* Added a new soundtrack, "Monarchy 2", by Allan "Quackus" Weiner!
* Fixed various bugs
* Full Changelog can be found at https://docs.google.com/document/d/1M0mxPMobF79kyU8XHRvIrWKbIk6v8WotAPLwUnbOuFg
324 changes: 324 additions & 0 deletions crash_logs.log

Large diffs are not rendered by default.

106 changes: 101 additions & 5 deletions engine/ball.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ def __init__(self, species = "soccer_ball", x_pos = 902, y_pos = 900, x_speed =
self.status_effects = {
'glued': 0,
'zapped': 0,
'bubbled': 0,
}
self.bubble = None

ground = 1240

Expand All @@ -91,6 +93,7 @@ def reset(self):
self.image = type_to_image("soccer_ball")
for effect in self.status_effects:
self.status_effects[effect] = 0
self.bubble=None

def check_blob_collisions(self):
#The distance to p1's blob
Expand All @@ -114,6 +117,7 @@ def check_blob_collisions(self):
self.x_speed = 0
blob.collision_timer = 0
self.info['blob_warp_collisions'] += 1
self.update_bubble_status(None, blob)
elif(abs(blob.x_center - self.x_center) <= blob_collision_distance) and not self.grounded:
#True if x is close enough, and ball is airborne.
if(self.y_speed < 0): #Are we moving upwards?
Expand All @@ -128,6 +132,7 @@ def check_blob_collisions(self):
else:
self.info['blob_reflect_collisions'] += 1
createSFXEvent('ball_blob_bounce', volume_modifier = ((self.x_speed**2 +self.y_speed**2)/(self.x_speed_max**2 + self.y_speed_max**2))**(1/3))
self.update_bubble_status(None, blob)

elif(blob.y_center >= self.y_center): #Is the ball above the blob?
if(p1_vector.distance_to(ball_vector) < 80):
Expand Down Expand Up @@ -163,8 +168,10 @@ def check_blob_collisions(self):
self.x_speed *= self.bounciness
self.y_speed *= self.bounciness
for other_blob in blob.all_blobs.values():
if(other_blob.special_ability == "hook" and other_blob.special_ability_timer):
if(other_blob.special_ability == "hook" and other_blob.special_ability_timer and other_blob.status_effects['silenced'] < 350):
other_blob.status_effects['silenced'] += 360
self.update_bubble_status(None, blob)
#blob.take_damage(damage = 1, unblockable=True, unclankable=True)
#print("speed", p1_ball_collision, "loc diff", p1_ball_nv)
elif p1_vector.distance_to(ball_vector) <= blob_collision_distance and ((self.goal_grounded and blob.y_pos < 875) or not self.goal_grounded): #Standard collision
self.info['blob_standard_collisions'] += 1
Expand All @@ -182,7 +189,7 @@ def check_blob_collisions(self):
self.y_speed *= self.bounciness

createSFXEvent('ball_blob_bounce', volume_modifier = ((self.x_speed**2 + self.y_speed**2)/(self.x_speed_max**2 + self.y_speed_max**2))**(1/3))

self.update_bubble_status(None, blob)
else:
#Debug
if(abs(blob.x_center - self.x_center) < blob_collision_distance):
Expand All @@ -204,6 +211,7 @@ def check_blob_collisions(self):
self.x_speed = 0
blob.collision_timer = 0
self.info['blob_warp_collisions'] += 1
self.update_bubble_status(None, blob)
self.check_ceiling_collisions()

def check_block_collisions(self):
Expand Down Expand Up @@ -256,22 +264,29 @@ def get_blocked(self, collision_timer_duration, blob):
for other_blob in blob.all_blobs.values():
if(other_blob.player != blob.player):
other_blob.collision_timer = collision_timer_duration
if(other_blob.special_ability == "hook" and other_blob.special_ability_timer):
if(other_blob.special_ability == "hook" and other_blob.special_ability_timer and other_blob.status_effects['silenced'] < 350):
other_blob.status_effects['silenced'] += 360
#Stops the ball completely
if(blob.block_timer == blob.block_timer_max - 3):
self.info['blocked'] += 1
self.bounciness = 0.1
self.blocked_timer = 20
self.update_bubble_status(None)

def check_blob_ability(self):
for blob in self.all_blobs.values():
if("fireball" in blob.used_ability):
self.x_speed *= (1.05 - (self.x_speed/1000))
self.y_speed *= (1.05 - (self.y_speed/1000))
if(self.bubble):
self.bubble.x_speed = self.bubble.x_orbit * 1.05
self.bubble.y_speed = self.bubble.y_orbit * 1.05
elif("snowball" in blob.used_ability):
self.x_speed *= .975
self.y_speed *= (.9 - (self.y_speed/1000))
if(self.bubble):
self.bubble.x_speed = self.bubble.x_orbit * -.4
self.bubble.y_speed = self.bubble.y_orbit * -.4
elif("geyser" in blob.used_ability):
try:
geyser_power = math.sqrt(Ball.ground - self.y_pos)/4-5
Expand All @@ -281,13 +296,22 @@ def check_blob_ability(self):
self.y_speed += geyser_power #Effectively, it's twice as powerful
else:
self.y_speed -= 0.8
if(self.bubble and geyser_power < 0):
self.bubble.y_speed += geyser_power
except Exception as exception:
self.y_speed -= 5
if(self.bubble):
self.bubble.y_speed -= 5
elif("gale" in blob.used_ability and not blob.collision_timer):
if(blob.player == 1 and self.x_speed < 15):
self.x_speed += 0.4
elif(blob.player == 2 and self.x_speed > -15):
self.x_speed -= 0.4
if(self.bubble and blob.player == 1):
self.bubble.x_speed = 4
elif(self.bubble and blob.player == 2):
self.bubble.x_speed = -4

elif("stoplight" in blob.used_ability):
self.x_speed = 0
self.y_speed = 0
Expand All @@ -297,9 +321,14 @@ def check_blob_ability(self):
for other_blob in blob.all_blobs.values():
if(other_blob.special_ability == "hook" and blob.special_ability_timer):
other_blob.special_ability_timer = 1
self.update_bubble_status()
elif("mirror" in blob.used_ability):
self.x_speed *= -0.9
self.y_speed *= -0.5
if(self.bubble and self.bubble.player == 1):
self.bubble.player = 2
elif(self.bubble and self.bubble.player == 2):
self.bubble.player = 1
elif("hook" in blob.used_ability):
if(blob.ability_holding_timer > blob.special_ability_delay and not self.species == "blocked_ball"):
# After the delay, start reeling the ball in. This is a gradual
Expand Down Expand Up @@ -327,6 +356,7 @@ def check_blob_ability(self):
'''if(abs(self.x_speed) > 5):
self.x_speed *= 0.95'''
# Change the number after // - bigger means the pulling force is weaker
self.update_bubble_status() # Pop the current bubble, if possible
elif(not self.species == "blocked_ball"):
x_dist = (self.x_center - blob.x_center)**2
y_dist = (self.y_center - blob.y_center)**2
Expand Down Expand Up @@ -365,29 +395,39 @@ def check_environmental_collisions(self, environment):
for hazard in environment['spire_spike']:
if("ball" in hazard.affects):
if(hazard.lifetime == hazard.max_lifetime - 1 and self.y_pos >= 900):
if(self.bubble):
print("Spire called!")
self.update_bubble_status()
createSFXEvent('ball_spire_hit')
self.y_speed = -50



for hazard in environment['thunder_glyph']:
hazard.x_pos = self.x_pos - 40

for hazard in environment['thunder_bolt']:
if("ball" in hazard.affects):
if(hazard.lifetime == hazard.max_lifetime - 1):
if(self.bubble):
self.update_bubble_status()
self.y_speed = Ball.ground - self.y_pos
self.status_effects['zapped'] += 120


for hazard in environment['cactus_spike']:
if("ball" in hazard.affects):

ball_vector = pg.math.Vector2(self.x_center, self.y_center + 50)
hazard_vector = pg.math.Vector2(hazard.x_pos, hazard.y_pos)
hazard_vector = pg.math.Vector2(hazard.x_pos, hazard.y_pos + 20)

#print("X", hazard.x_pos, self.x_pos)
#print("Y", hazard.y_pos, self.y_pos)

dist_vector = hazard_vector.distance_to(ball_vector)
if(dist_vector < 75):
if(self.bubble):
self.update_bubble_status()
try:
hazard.lifetime = 0
ball_nv = pg.math.Vector2(self.x_pos - hazard.x_pos, (self.y_pos + 50) - hazard.y_pos)
Expand All @@ -400,6 +440,7 @@ def check_environmental_collisions(self, environment):
if(not self.species == "blocked_ball"):
self.x_speed = 0
self.y_speed = -10


continue

Expand All @@ -413,6 +454,45 @@ def check_environmental_collisions(self, environment):
hazard.y_pos -= hazard_nv[1] * 2
#print(hazard_nv.length())

for hazard in environment['bubble']:
if("ball" in hazard.affects):
ball_vector = pg.math.Vector2(self.x_center, self.y_center)
hazard_vector = pg.math.Vector2(hazard.x_pos + 60, hazard.y_pos + 60)

#print("X", hazard.x_pos, self.x_pos)
#print("Y", hazard.y_pos, self.y_pos)

dist_vector = hazard_vector.distance_to(ball_vector)
#print(dist_vector, self.y_center, hazard.y_pos + 60)
if(dist_vector < 135 and hazard.lifetime > 1):
try:
#hazard.lifetime = 0
#ball_nv = pg.math.Vector2(self.x_pos - hazard.x_pos, (self.y_pos + 50) - hazard.y_pos)
#ball_nv.scale_to_length(20)
#if(not self.species == "blocked_ball"):
#self.x_speed = ball_nv[0]
#self.y_speed = ball_nv[1]
self.x_speed = hazard.x_speed
self.y_speed = hazard.y_speed
self.x_pos = hazard.x_pos + 60 - 5
self.y_pos = hazard.y_pos + 30
self.status_effects['bubbled'] = hazard.lifetime
#print("TRY", self.y_center - (hazard.y_pos + 60))
except:
#hazard.lifetime = 0
if(not self.species == "blocked_ball"):
self.x_speed = 0
self.y_speed = -10
self.x_pos = hazard.x_pos + 60 - 5
self.y_pos = hazard.y_pos + 30
self.status_effects['bubbled'] = hazard.lifetime
#print("EXCEPTION", self.y_center - (hazard.y_pos + 60))

if(self.bubble != hazard or self.bubble.lifetime == 1):
self.update_bubble_status(hazard)

continue




Expand Down Expand Up @@ -443,6 +523,10 @@ def move(self): # Also has cooldowns in it.
self.previous_locations = self.previous_locations[1:]

#Traction/Friction
if(self.bubble):
self.x_speed = self.bubble.x_orbit + self.bubble.x_speed
self.y_speed = self.bubble.y_orbit + self.bubble.y_speed

def apply_traction_friction():
ball_traction = self.traction
if(self.status_effects['glued']):
Expand Down Expand Up @@ -624,4 +708,16 @@ def apply_y_speed_limits():
for effect in self.status_effects:
if(self.status_effects[effect] > 0):
self.status_effects[effect] -= 1

if(self.status_effects["bubbled"] == 0):
self.bubble = None

def update_bubble_status(self, bubble = None, blob = None):
current_bubble = self.bubble
self.bubble = bubble
if(current_bubble):
current_bubble.lifetime = 0
self.x_speed = (current_bubble.x_speed + current_bubble.x_orbit) * 2
self.y_speed = (current_bubble.y_speed + current_bubble.y_orbit) * 2
if(blob and self.status_effects['bubbled']):
blob.take_damage(damage = 1, unblockable=True, unclankable=True)
self.status_effects['bubbled'] = 0
2 changes: 2 additions & 0 deletions engine/blob_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def species_to_stars(species, stat_overrides):
'taco': create_dict(2, 2, 3, 3, 3, 2, 2, 600, 2, 2, 'monado', 360, 0, 1800, 180, 0, 0),
'cactus': create_dict(3, 3, 4, 2, 4, 2, 3, 600, 3, 3, 'spike', 600, 0, 1800, 240, 0, 0),
'merchant': create_dict(2, 2, 4, 4, 4, 1, 1, 600, 3, 3, 'shop', 750, 0, 2400, 120, 0, 0),
'bubble': create_dict(2, 3, 4, 2, 3, 3, 3, 600, 3, 3, 'bubble', 300, 0, 1800, 180, 0, 0),
}

blob_dict = full_dict[species]
Expand Down Expand Up @@ -108,6 +109,7 @@ def species_to_stars(species, stat_overrides):
'taco': ability_cwd + 'filling.png',
'cactus': ability_cwd + 'cactus_spike.png',
'merchant': ability_cwd + 'coin.png',
'bubble': ability_cwd + 'bubble.png',
"random": icon_cwd + "boost_icon.png",
}

Expand Down
16 changes: 16 additions & 0 deletions engine/blob_tips.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,21 @@
tip_font.render("and getting passive damage reduction and faster blocks.", False, text_color),
]

bubble_tips = [
tip_font.render("#1: Bubbles will float around in circles. The", False, text_color),
tip_font.render("direction is dependent on the player's team!", False, text_color),
tip_font.render("", False, text_color),
tip_font.render("#2: While the ball is caught in a bubble, ", False, text_color),
tip_font.render("it gains a damaging effect! Touching the ball", False, text_color),
tip_font.render("will hurt you a little bit.", False, text_color),
tip_font.render("", False, text_color),
tip_font.render("#3: While the ball is caught in a bubble,", False, text_color),
tip_font.render("many abilities will affect the bubble!", False, text_color),
tip_font.render("", False, text_color),
tip_font.render("#4: Popping the bubble at any point will launch", False, text_color),
tip_font.render("the ball, regardless of when or how!", False, text_color),
]

def return_selected_blob_tips(selected_blob):
tips_dict = {
'quirkless': quirkless_tips,
Expand All @@ -386,6 +401,7 @@ def return_selected_blob_tips(selected_blob):
'taco': taco_tips,
'cactus': cactus_tips,
'merchant': merchant_tips,
'bubble': bubble_tips,
}
try:
return tips_dict[selected_blob]
Expand Down
Loading

0 comments on commit bd1682c

Please sign in to comment.