i want to know what i did wrong? #261
Replies: 3 comments 4 replies
-
|
What's the issue? |
Beta Was this translation helpful? Give feedback.
-
|
Could you please tell us what is wrong? We do not have access to your spike model so if the issue is related to the "game over" text instantly appearing, we may not be able to help until we know what the collision box looks like for that model. |
Beta Was this translation helpful? Give feedback.
-
|
To fix the instantaneous "Game Over" screen, you can change line 37 to this: hiti=spikes.intersects(player)Passing in the player object causes The issue that arises here is that the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
``from
ursina` `import` `*``from` `random` import randint
import math
from ursina.prefabs.platformer_controller_2d import PlatformerController2d
app = Ursina()
window.title = 'My Game'
window.iconbitmap="bb.ico"
window.exit_button.visible = True
window.minimize_button=False
window.background='background'
Sky(texture="sky.jpg")
entities=[]
player=PlatformerController2d(scale_y=1, x=-24,jump_height=5, collider="box", y=10)
ground = Entity(model='quad', y=-2, scale_x=50, collider="box", scale_y=10, texture = "ground")
camera.add_script(SmoothFollow(target=player, offset=[0,1,-30]))
ground2 = Entity(model='quad', y=-2, scale_x=50, collider="box", scale_y=10, texture = "ground")
wall=Entity(model="quad", x=-25, scale_y=50, collider="box", texture="wall")
spikes=Entity(model="spike", x=27, collider="box", scale=0.05, y=-5)
wall2=Entity(model="quad", x=-26,scale_y=50, collider="box", texture="wall")
ground2 = Entity(model='quad', y=-2, scale_x=50, collider="box", scale_y=10, texture = "ground", x=50)
def update():
EditorCamera()
app.run()``
my code
Beta Was this translation helpful? Give feedback.
All reactions