Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Hello, I am on my way to make my own game, I am currently using the Shooting Game Plugin by Wendy!
Because this is a very new territory for me, I have no idea how to fix it. At the moment, when time is up, you lose all of your life, and even if time is up, you can't shoot again. Once you shoot, you will also receive a game over.
The goal of this is to ensure that you lose one life each time you shoot until it is truly game over, with zero lives and zero bullets remaining.
Only thing I have done is fix a way to jump to a game over or win screen
if hunt.status.is_game_over():
# Check if the player won or lost
if hunt.status.life_now <= 0:
# Player lost
jump game_over
else:
# Player won
jump win
Last edited by Kyren on Tue Mar 12, 2024 11:04 am, edited 2 times in total.
I fixed the health issue but now the issue I bumped into is the game still thinks it is Game Over once you're at 0 life. Pretty much once you are at 0 life and shoot a bullet you end up in a game over screen. Here are some updated codes
def is_game_over(self):
# Check if the game is over
if self.time_left == 0:
if self.bullet_now <= 0 and self.round_now <= self.round_nb:
return True
if self.time_left > 0 and self.life_now <= 0:
return True
return False
EDIT: This works fine, just idk how the game can tell if the life is 0 it is game over. I guess I will go with it this unless there are someone that knows how to fix it
I fixed the health issue but now the issue I bumped into is the game still thinks it is Game Over once you're at 0 life. Pretty much once you are at 0 life and shoot a bullet you end up in a game over screen. Here are some updated codes
def is_game_over(self):
# Check if the game is over
if self.time_left == 0:
if self.bullet_now <= 0 and self.round_now <= self.round_nb:
return True
if self.time_left > 0 and self.life_now <= 0:
return True
return False
EDIT: This works fine, just idk how the game can tell if the life is 0 it is game over. I guess I will go with it this unless there are someone that knows how to fix it
UPDATE! For some reason once bullet hits 0 it doesn't give game over for some reason.
def is_game_over(self):
# Check if the game is over
if self.time_left == 0:
if self.bullet_now <= 0 and self.round_now <= self.round_nb:
return True
if self.time_left > 0 and self.life_now <= 0:
return True
return False
def attack(self, status, targets):
# Perform player attack and hit detection
renpy.call_screen("gun")
self.hit_pos = [renpy.get_mouse_pos()[0], renpy.get_mouse_pos()[1]]
for i in range(self.config.target_nb):
if not targets[i].killed:
pos = targets[i].get_pos()
if self.is_hit(pos, targets[i].image_size):
targets[i].hide()
targets[i].killed = True
status.target_now -= 1
renpy.with_statement(vpunch)
if self.fired and status.bullet_now > 0: # Check if the player fires and has bullets left
status.bullet_now -= 1 # Only decrement bullet count if the player fires and has bullets
self.fired = False
return None
Last edited by Kyren on Tue Mar 12, 2024 3:52 pm, edited 1 time in total.
def is_game_over(self):
# Check if the game is over
if self.time_left == 0:
if self.bullet_now <= 0 and self.round_now <= self.round_nb:
return True
if self.time_left > 0 and self.life_now <= 0:
return True
return False
EDIT: This works fine, just idk how the game can tell if the life is 0 it is game over. I guess I will go with it this unless there are someone that knows how to fix it
Function is_game_over() returns True if game over, and False if game is not over.
def is_game_over(self):
# Check if the game is over
if self.time_left == 0:
if self.bullet_now <= 0 and self.round_now <= self.round_nb:
return True
if self.time_left > 0 and self.life_now <= 0:
return True
return False
EDIT: This works fine, just idk how the game can tell if the life is 0 it is game over. I guess I will go with it this unless there are someone that knows how to fix it
Function is_game_over() returns True if game over, and False if game is not over.