The0Felon
Altın Benim Yeni Sevgilim
- Katılım
- 28 Şubat 2022
- Mesajlar
- 458
- Elmaslar
- 75
- Puan
- 6.955
- Konum
- Türkiye
- Minecraft
- The2Felon
Discord:
0mustafa
Merhabalar, sizlere oynaya oynaya geliştirdiğim ve keyif aldığım bir mini-oyunu tanıtacağım.
Bu oyun bir futbol türemesi. Bir top var ve topa vurarak topu ilerletiyorsunuz. Ana amaç karşınızdakinin kalesine topu geçirmek.
Bu oyun bir futbol türemesi. Bir top var ve topa vurarak topu ilerletiyorsunuz. Ana amaç karşınızdakinin kalesine topu geçirmek.
Bu oyunda 3 özellik var:
- Atılma (Dash): Oyunun çekişmesini arttırmak için eklendi. F tuşuyla (veya el değiştirme tuşu da denilebilir.) etkinleşiyor. 3 saniyelik bir bekleme süresi var.
- Topa Vurma: Topa hasar verince (tıklayınca) gerçekleşir. Topa vurmak olarak adlandırılabilir. Oyuncu ve top arasındaki vektörü hesaplayarak vuruş gerçekleştirilir. Bekleme süresi yoktur.
- Oyuncuya Vurma: Bir oyuncuya hasar verince (tıklayınca) vurulan oyuncu geri tepilir. Ataklarda savunmayı bozmak için kullanışlıdır.
Top olarak armadillo kullandım. Kare top haline gelebilmesi nedeniyle hızlı ve zahmetsiz bir çözüm oldu benim için. Daha gelişmiş özel varlıklar kullanılabilir.
Bu kodu keyif olsun diye yazdım, yazarken herhangi bir ciddiyetim yoktu. İstediğiniz gibi güncelleştirip daha iyi bir versiyonunu çıkartabilirsiniz. Genel olarak kodların nasıl çalıştığına göz atmak isteyebilirsiniz. Arkadaşlarınızla oynamaya uygun, güzel bir mini-oyun olduğunu düşünüyorum.
FOTOĞRAFLAR
KOD
Python:
options:
santraLokasyon: location(0,0,0 , world "world") # Topun yaratılacağı lokasyon.
sahaDisiBlok: light gray concrete or gray concrete # Sahanın dışına konulacak blok.
command /freset:
permission: op
permission message: &cBu komuta iznin yok.
trigger:
kill last spawned armadillo
spawn armadillo at {@santraLokasyon}
set {_e} to last spawned armadillo
apply infinite potion of glowing without particles to {_e}
make {_e} silent
liveLoop({_e})
on damage:
cancel event
if event-projectile is set:
kill event-projectile
stop
set {_v} to normalized vector between attacker and victim
if victim is a player:
if {football.pushCooldown::%attacker%} isn't true:
set y component of {_v} to 0.7
push victim {_v} with force (0.06 / vector length of velocity of victim)
set {football.pushCooldown::%attacker%} to true
play sound "minecraft:item.armor.equip_leather" to players at victim
make 4 of spit at head location of victim with offset vector(0.5, 0.8, 0.5) with extra 0.1
wait 2 seconds
delete {football.pushCooldown::%attacker%}
else if victim is a armadillo:
set {_loc} to location of victim
remove 0.01 from y-coord of {_loc}
if block at {_loc} is air:
set vector length of {_v} to 5
set y component of {_v} to 2
else:
set vector length of {_v} to 3
set y component of {_v} to 2
push victim {_v}
on swap hand item:
cancel event
if {football.dashed::%player%} isn't true:
set {football.dashed::%player%} to true
set {_v} to normalized vector from yaw yaw of player and pitch pitch of player
set y component of {_v} to 0
set {_loc} to location of player
remove 0.01 from y-coord of {_loc}
if block at {_loc} is solid:
push player {_v} with force 1.2
else:
push player {_v} with force 1
play sound "entity.bat.takeoff" to players at player
make 8 of poof at player with offset vector(1,1,1) with extra 0.3
wait 2.5 seconds
delete {football.dashed::%player%}
local function liveLoop(e: entity):
while {_e} is alive:
if vector length of velocity of {_e} > 0.5:
set vector length of velocity of {_e} to 0.5
if y component of velocity of {_e} < -0.15:
set y component of velocity of {_e} to -0.15
set string tag "state" of nbt of {_e} to "scared"
if block under {_e} is {@sahaDisiBlok}:
make 5 of poof at {_e} with extra 0.001
wait a tick
on explode:
cancel event
Son düzenleme: