×

Langue

Fermer
Atelier 801
  • Forums
  • Dev Tracker
  • Connexion
    • English Français
      Português do Brasil Español
      Türkçe Polski
      Magyar Română
      العربية Skandinavisk
      Nederlands Deutsch
      Bahasa Indonesia Русский
      中文 Filipino
      Lietuvių kalba 日本語
      Suomi עברית
      Italiano Česky
      Hrvatski Slovensky
      Български Latviešu
      Estonian
  • Langue
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • [Script]Portal Gun
[Script]Portal Gun
Otroivan
« Citoyen »
1387915620000
    • Otroivan#0000
    • Profil
    • Derniers messages
    • Tribu
#1
  0
Basado en el juego Portal
Haz click en cualquier lugar para disparar
Script a dit :
objects = {}
tfm.exec.disableAutoScore(false)
tfm.exec.disableAutoShaman(true)
tfm.exec.disableAutoNewGame(true)

function eventLoop()
if objects.id ~= nil then
objects.x = tfm.get.room.objectList[objects.id].x
objects.y = tfm.get.room.objectList[objects.id].y
if (objx and objy) then
if objx > objects.x - 2 and objx < objects.x + 2 and objy < objects.y + 2 and objy > objects.y - 2 then
toDespawn = objects.id
if portal == (nil or 1) then
tfm.exec.addShamanObject(26, objects.x, objects.y)
portal = 2
else
tfm.exec.addShamanObject(27, objects.x, objects.y)
portal = 1
end
else
objx = objects.x
objy = objects.y
end
else
objx = objects.x
objy = objects.y
end
if toDespawn then
tfm.exec.removeObject(toDespawn)
objects.id = nil
toDespawn = nil
end
end
end

function initPlayer(name)
system.bindMouse(name, true)
end

for name in pairs(tfm.get.room.playerList) do
initPlayer(name)
end

function eventNewPlayer(name)
initPlayer(name)
tfm.exec.respawnPlayer(name)
end

function eventMouse(name, x, y)
local roomPlayer = tfm.get.room.playerList[name]
local dx = x - roomPlayer.x
local dy = y - roomPlayer.y
local angle = math.atan2(dy, dx)
local vx = math.cos(angle)
local vy = math.sin(angle)
if objects.id then
tfm.exec.removeObject(objects.id)
end
object = tfm.exec.addShamanObject(32, roomPlayer.x + 20 * vx, roomPlayer.y + 20 * vy, angle*180/math.pi, 0, 0, false)
objects.id = object
end

function eventPlayerDied(name)
tfm.exec.respawnPlayer(name)
end

function eventPlayerWon(name)
tfm.exec.respawnPlayer(name)
end

Hilo sacado de EN:Topic-507327
Catroosdos
« Citoyen »
1387921500000
    • Catroosdos#0000
    • Profil
    • Derniers messages
    • Tribu
#2
  0
Otroivan a dit :
Basado en el juego Portal
Haz click en cualquier lugar para disparar

Hilo sacado de EN:Topic-507327

Yo iva a hacer esto.
De todas maneras, buen hilo.
Kugineko
« Citoyen »
1387923840000
    • Kugineko#6324
    • Profil
    • Derniers messages
#3
  0
Es curiosa la forma que usó el autor para comprobar la colisión de las flechas con las superficies. Compara la posición de la flecha cada 0.5 segundos. Es algo que solo se puede lograr con la runa porque los otros objetos son muy rápidos y además generalmente rebotan en lugar de detenerse.

Supongo que sería un poco más fluido con timers pero aún así es difícil hacer algo jugable con esto );
Leoxdee
« Citoyen »
1399773900000
    • Leoxdee#0000
    • Profil
    • Derniers messages
#4
  0
no me funciona e.e
Ratonmita
1399774560000
    • Ratonmita#0000
    • Profil
    • Derniers messages
#5
[Modéré par Gehnna]
Bebekiremsul
« Citoyen »
1400997840000
    • Bebekiremsul#0000
    • Profil
    • Derniers messages
#6
  0
Topic-678183 < TR tema
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • [Script]Portal Gun
© Atelier801 2018

Equipe Conditions Générales d'Utilisation Politique de Confidentialité Contact

Version 1.27