elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Tutorial básico de Quickjs


+  Foro de elhacker.net
|-+  Programación
| |-+  Scripting
| | |-+  VBScript: Angry Birds Pong in VBScript [HTA + VBS] (100% Notepad) by JohnConnor
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: VBScript: Angry Birds Pong in VBScript [HTA + VBS] (100% Notepad) by JohnConnor  (Leído 4,829 veces)
JohnConnor

Desconectado Desconectado

Mensajes: 16


Cyberdine Systems


Ver Perfil WWW
VBScript: Angry Birds Pong in VBScript [HTA + VBS] (100% Notepad) by JohnConnor
« en: 4 Marzo 2013, 03:02 am »

Juego programado en VBScript y HTML (hta) con el Notepad.
by JohnConnor : Facundo Rinaldi 2 Code-Makers.com

Hola gente, les dejo el ultimo juego que hice, es un PONG . en realidad es el mismo que el anterior pero con algunas mejoras y nuevos graficos. Tambien agregue sonidos y publicidades.

Las teclas igual al anterior.

Un video de muestra:

Aca en codigo:

                     
Código
  1. Sub Window_OnLoad
  2. Cargando.Style.Display = "None"
  3. If Screen.Width < 800 or Screen.Height < 600 Then
  4. Msgbox "Error: 0x1028 " & Chr(13) & "Su resolucion de patalla no permite la ejecucion de la aplicacion."
  5. End If
  6. Self.ResizeTo 800,600
  7. Pantalla_De_Juego.Style.Display = "None"
  8. Pantalla_Ganador.Style.Display = "None"
  9. Menu_Principal.Style.Color = "Gray"
  10. Menu_Principal.Style.FontSize = "12"
  11. Menu_Principal.Style.Position = "Absolute"
  12. Menu_Principal.Style.Top = "70"
  13. Menu_Principal.Style.Left = "45"
  14. JugadorUnoP.Style.Position = "Absolute"
  15. JugadorDosP.Style.Position = "Absolute"
  16. JugadorUnoP.Style.fontSize = "50"
  17. JugadorDosP.Style.fontSize = "50"
  18. JugadorUnoP.Style.Top = "10"
  19. JugadorDosP.Style.Top = "10"
  20. JugadorUnoP.Style.Left = 300
  21. JugadorDosP.Style.Left = 500
  22.  
  23. ' --- Configuracion JugadorDos --- *
  24. JugadorUno.Style.Position = "Absolute"
  25. JugadorUno.Style.Width = "60"
  26. JugadorUno.Style.Height = "60"
  27. JugadorUno.Style.Top = "40"
  28. JugadorUno.Style.Left = "10"
  29.  
  30. ' --- Configuracion de JugadorDos --- *
  31. JugadorDos.Style.Position = "Absolute"
  32. JugadorDos.Style.Width = "60"
  33. JugadorDos.Style.Height = "60"
  34. JugadorDos.Style.Top = "90"
  35. JugadorDos.Style.Left = "740"
  36.  
  37.  
  38. ' --- Configuracion de Pelota --- *
  39. Pelota.Style.Position = "Absolute"
  40. Pelota.Style.Width = "30"
  41. Pelota.Style.Height = "30"
  42. Pelota.Style.Top = "100"
  43. Pelota.Style.Left = "100"
  44.  
  45. LD.Style.Position = "Absolute"
  46. LD.Style.Width = "3"
  47. LD.Style.Height = "600"
  48. LD.Style.Left = "400"
  49. LD.Style.Display = "None"
  50.  
  51. VolumenIMG.Style.Position = "Absolute"
  52. VolumenIMG.Style.Bottom = "15"
  53. VolumenIMG.Style.Right = "5"
  54. VolumenIMG.Style.ZIndex = "999"
  55.  
  56. FacebookIMG.Style.Position = "Absolute"
  57. FacebookIMG.Style.Bottom = "16"
  58. FacebookIMG.Style.Left = "5"
  59. FacebookIMG.Style.ZIndex = "999"
  60.  
  61. TwitterIMG.Style.Position = "Absolute"
  62. TwitterIMG.Style.Bottom = "15"
  63. TwitterIMG.Style.Left = "50"
  64. TwitterIMG.Style.ZIndex = "999"
  65.  
  66. Publicidad.Style.Position = "Absolute"
  67. Publicidad.Style.Bottom = "5"
  68. Publicidad.Style.Left = "160"
  69. Publicidad.Style.Width = "468"
  70. Publicidad.Style.Height = "60"
  71. Publicidad.Style.ZIndex = "9999"
  72. Publicidad.Style.OverFlow = "Hidden"
  73.  
  74. PublicidadDos.Style.Position = "Absolute"
  75. PublicidadDos.Style.Top = "170"
  76. PublicidadDos.Style.Left = "110"
  77. PublicidadDos.Style.Width = "300"
  78. PublicidadDos.Style.Height = "250"
  79. PublicidadDos.Style.ZIndex = "9999"
  80. PublicidadDos.Style.OverFlow = "Hidden"
  81.  
  82. FondoGanador.Style.Position = "Absolute"
  83. FondoGanador.Style.Top = "100"
  84. FondoGanador.Style.Left = "70"
  85.  
  86. IMGanador.Style.Position = "Absolute"
  87. IMGanador.Style.Top = "220"
  88. IMGanador.Style.Left = "500"
  89. Imganador.Style.Width = "150"
  90. Imganador.Style.Height = "150"
  91.  
  92. Piso.Style.Position = "Absolute"
  93. Piso.Style.Width = "800"
  94. Piso.Style.Height = "87"
  95. Piso.Style.Bottom = "0"
  96. Piso.Style.BackgroundImage = "Url(Imagenes/Piso.png)"
  97. JugadorUnoPTXT.Value = "0" : JugadorDosPTXT.Value = "0"
  98. JugadorUnoP.InnerHtml = "<img src=""Imagenes/p" & JugadorUnoPTXT.Value & ".png"">" : JugadorDosP.InnerHtml = "<img src=""Imagenes/p" & JugadorDosPTXT.Value & ".png"">"
  99. End Sub
  100.  
  101.  
  102. Sub Document_OnKeyPress
  103.  
  104. If Window.Event.KeyCode = "27" Then : Salir : End If
  105. If Window.Event.KeyCode = "13" Then : Comenzar : Volver : If E.Value = "0" Then : MusicaMaestro = Window.SetTimeOut("SonidosJuego.Src = ""Sonidos/BotonOk.wav""",1)  : Movimiento_Pelota : E.Value = "1" :  End If : End If
  106.  
  107. If Window.Event.KeyCode = "119" Then : JUArriba.Value = "-4" : End If
  108. If Window.Event.KeyCode = "115" Then : JUAbajo.Value = "4" :  End If
  109.  
  110. If Window.Event.KeyCode = "105" Then : JDArriba.Value = "-4" : End If
  111. If Window.Event.KeyCode = "107" Then : JDAbajo.Value = "4" : End If
  112. End Sub
  113.  
  114.  
  115. Sub Document_OnKeyUp
  116. If Window.Event.KeyCode = "87" Or Window.Event.KeyCode = "83" Then : JUArriba.Value = "0" : JUAbajo.Value = "0" : End If
  117. If Window.Event.KeyCode = "73" Or Window.Event.KeyCode = "75" Then : JDArriba.Value = "0" : JDAbajo.Value = "0" : End If
  118. End Sub
  119.  
  120. Sub BotonArrancar_OnMouseOver
  121. MusicaMaestro = Window.SetTimeOut("SonidosAmbiente.Src = ""Sonidos/BotonArriba.wav""",1)
  122. BotonArrancar.SRC= "Imagenes/startbd.png"
  123. End Sub
  124.  
  125. Sub BotonArrancar_OnMouseOut
  126. If E.Value = "0" Then
  127. MusicaMaestro = Window.SetTimeOut("SonidosAmbiente.Src = ""Sonidos/Menu_Principal.mp3""",1)
  128. BotonArrancar.SRC= "Imagenes/startb.png"
  129. End If
  130. End Sub
  131.  
  132. Sub BotonArrancar_OnClick
  133. MusicaMaestro = Window.SetTimeOut("SonidosJuego.Src = ""Sonidos/BotonOk.wav""",1)
  134. Comenzar : Movimiento_Pelota : E.Value = "1"
  135. End Sub
  136.  
  137.  
  138.  
  139. Sub Comenzar
  140. Menu_Principal.Style.Display = "None"
  141. Pantalla_De_Juego.Style.Display = "InLine"
  142. MusicaMaestro = Window.SetTimeOut("SonidosAmbiente.Src = ""Sonidos/AmbienteJuego.mp3""",400)
  143. SonidosAmbiente.Volume = "0"
  144. End Sub
  145.  
  146. Sub MoverJugadorUno(Mov)
  147. JugadorUno.Style.Top = CInt(Replace(JugadorUno.Style.Top,"px","")) + CInt(Mov)
  148. End Sub
  149.  
  150. Sub MoverJugadorDos(Mov)
  151. JugadorDos.Style.Top = CInt(Replace(JugadorDos.Style.Top,"px","")) + CInt(Mov)
  152. End Sub
  153.  
  154. Sub Movimiento_Pelota
  155.  
  156. If JugadorUnoPTXT.Value > 9 Then
  157. MusicaMaestro = Window.SetTimeOut("SonidosAmbiente.Src = ""Sonidos/Juego_Ganado.mp3""",1)
  158. Pantalla_Ganador.Style.Display = "Inline"
  159. IMGanador.SRC = "Imagenes/JU.png"
  160. Exit Sub
  161. End If
  162.  
  163. If JugadorDosPTXT.Value > 9 Then
  164. MusicaMaestro = Window.SetTimeOut("SonidosAmbiente.Src = ""Sonidos/Juego_Ganado.mp3""",1)
  165. Pantalla_Ganador.Style.Display = "Inline"
  166. IMGanador.SRC = "Imagenes/JD.png"
  167. Exit Sub
  168. End If
  169.  
  170. If Replace(Pelota.Style.Top,"px","") > 463 Then
  171. DireccionPelotaX.Value = CInt(-4)
  172. MusicaMaestro = Window.SetTimeOut("SonidosJuego.Src = ""Sonidos/Pajaro_Rebotando.wav""",1)
  173. End If
  174. If Replace(Pelota.Style.Top,"px","") < 1 Then
  175. DireccionPelotaX.Value = CInt(+4)
  176. MusicaMaestro = Window.SetTimeOut("SonidosJuego.Src = ""Sonidos/Pajaro_Rebotando.wav""",1)
  177. End If
  178. If Replace(Pelota.Style.Left,"px","") > 780 Then
  179. Pelota.Style.Left = "760"
  180. DireccionPelotaY.Value = CInt(-4)
  181. MusicaMaestro = Window.SetTimeOut("SonidosJuego.Src = ""Sonidos/Festejo.wav""",1)
  182. IMGP.SRC = "Imagenes/1.png"
  183. JugadorUnoPTXT.Value = JugadorUnoPTXT.Value + Cint(1)
  184. JugadorUnoP.InnerHtml = "<img src=""Imagenes/p" & JugadorUnoPTXT.Value & ".png"">"
  185. End If
  186. If Replace(Pelota.Style.Left,"px","") < 0 Then
  187. Pelota.Style.Left = "0"
  188. DireccionPelotaY.Value = CInt(+4)
  189. MusicaMaestro = Window.SetTimeOut("SonidosJuego.Src = ""Sonidos/Festejo.wav""",1)
  190. IMGP.SRC = "Imagenes/0.png"
  191. JugadorDosPTXT.Value = JugadorDosPTXT.Value + Cint(1)
  192. JugadorDosP.InnerHtml = "<img src=""Imagenes/p" & JugadorDosPTXT.Value & ".png"">"
  193. End If
  194. If Coliciones(Replace(JugadorUno.Style.Left,"px",""), Replace(JugadorUno.Style.Width,"px",""), Replace(JugadorUno.Style.Top,"px",""),Replace(JugadorUno.Style.Height,"px",""), Replace(Pelota.Style.Left,"px",""), Replace(Pelota.Style.Width,"px",""), Replace(Pelota.Style.Top,"px",""), Replace(Pelota.Style.Height,"px","")) = "Verdadero" Then
  195. 'Pelota.Style.BackgroundColor = "Yellow"
  196. MusicaMaestro = Window.SetTimeOut("SonidosJuego.Src = ""Sonidos/Tiro.wav""",1)
  197. MusicaMaestro = Window.SetTimeOut("SonidosJuego.Src = ""Sonidos/Pajaro_Volando.wav""",300)
  198.  
  199. DireccionPelotaY.Value = CInt(+ Int((8 - 5 + 1) * RND + 5))
  200. If DireccionPelotaX.Value > 0 Then
  201. DireccionPelotaX.Value = CInt(+ Int((10 - 1 + 1) * RND + 1))
  202. Else
  203. DireccionPelotaX.Value = CInt(- Int((10 - 1 + 1) * RND + 1))
  204. End If
  205. IMGP.SRC = "Imagenes/0.png"
  206. Else
  207. 'Pelota.Style.BackgroundColor = "White"
  208. End If
  209. If Coliciones(Replace(JugadorDos.Style.Left,"px",""), Replace(JugadorDos.Style.Width,"px",""), Replace(JugadorDos.Style.Top,"px",""),Replace(JugadorDos.Style.Height,"px",""), Replace(Pelota.Style.Left,"px",""), Replace(Pelota.Style.Width,"px",""), Replace(Pelota.Style.Top,"px",""), Replace(Pelota.Style.Height,"px","")) = "Verdadero" Then
  210. 'Pelota.Style.BackgroundColor = "Yellow"
  211. MusicaMaestro = Window.SetTimeOut("SonidosJuego.Src = ""Sonidos/Tiro.wav""",1)
  212. MusicaMaestro = Window.SetTimeOut("SonidosJuego.Src = ""Sonidos/PajaroVolando.wav""",300)
  213. DireccionPelotaY.Value = CInt(- Int((8 - 5 + 1) * RND + 5))
  214. If DireccionPelotaX.Value < 0 Then
  215. DireccionPelotaX.Value = CInt(- Int((10 - 1 + 1) * RND + 1))
  216. Else
  217. DireccionPelotaX.Value = CInt(+ Int((10 - 1 + 1) * RND + 1))
  218. End If
  219. IMGP.SRC = "Imagenes/1.png"
  220. Else
  221. 'Pelota.Style.BackgroundColor = "White"
  222. End If
  223.  
  224. Pelota.Style.Top = Cint(Replace(Pelota.Style.Top,"px","")) + Cint(DireccionPelotaX.Value)
  225. Pelota.Style.Left = Cint(Replace(Pelota.Style.Left,"px","")) + Cint(DireccionPelotaY.Value)
  226.  
  227. If Replace(JugadorUno.Style.Top,"px","") < 2 Then : JugadorUno.Style.Top = 2 : End If
  228. If Replace(JugadorUno.Style.Top,"px","") > 433 Then : JugadorUno.Style.Top = 433 : End If
  229.  
  230. If Replace(JugadorDos.Style.Top,"px","") < 2 Then : JugadorDos.Style.Top = 2 : End If
  231. If Replace(JugadorDos.Style.Top,"px","") > 433 Then : JugadorDos.Style.Top = 433 : End If
  232.  
  233. MoverJugadorUno(JUArriba.value) :  MoverJugadorDos(JDArriba.value)  : MoverJugadorUno(JUAbajo.Value) : MoverJugadorDos(JDAbajo.Value)
  234.  
  235. MP = Window.SetTimeOut("Movimiento_Pelota",1)
  236. End Sub
  237.  
  238. Function Coliciones(x1, width1, y1, height1,x2, width2, y2, height2)
  239. If  (CInt(x1) + CInt(width1)) > (CInt(x2)) and (CInt(x1)) < (CInt(x2) + CInt(width2)) And (CInt(y1) + CInt(height1)) > (CInt(y2)) and (CInt(y1)) < (CInt(y2) + CInt(height2)) Then
  240. Coliciones = "Verdadero"
  241. Else
  242. Coliciones = "Falso"
  243. End If
  244. End Function
  245.  
  246. Sub IniMSJPre
  247. If IniMSJV.Value = "A" then
  248. Ini_MSJ.Style.Display = "None"
  249. IniMSJV.Value = "B"
  250. Else
  251. Ini_MSJ.Style.Display = "Inline"
  252. IniMSJV.Value = "A"
  253. End If
  254. End Sub
  255.  
  256. Sub Salir
  257. Set WshShell = CreateObject("WScript.Shell")
  258. Return = WshShell.Run("http://angrybirds.hol.es/pong/Comparte.php", 1,False)
  259. Self.Close
  260. End Sub
  261.  
  262. Sub TwitterIMG_OnMouseOver
  263. TwitterIMG.SRC = "Imagenes/Twitter0.png"
  264. End Sub
  265.  
  266. Sub FacebookIMG_OnMouseOver
  267. FacebookIMG.SRC = "Imagenes/Facebook0.png"
  268. End Sub
  269.  
  270. Sub TwitterIMG_OnMouseOut
  271. TwitterIMG.SRC = "Imagenes/Twitter1.png"
  272. End Sub
  273.  
  274. Sub FacebookIMG_OnMouseOut
  275. FacebookIMG.SRC = "Imagenes/Facebook1.png"
  276. End Sub
  277.  
  278. Sub TwitterIMG_OnClick
  279. Set WshShell = CreateObject("WScript.Shell")
  280. Return = WshShell.Run("http://www.twitter.com/AngryBirdsPong", 1,False)
  281. End Sub
  282.  
  283. Sub FacebookIMG_OnClick
  284. Set WshShell = CreateObject("WScript.Shell")
  285. Return = WshShell.Run("http://fb.me/AngryBirdsPong", 1,False)
  286. End Sub
  287.  
  288. Sub VolumenIMG_OnMouseOver
  289. VolumenIMG.SRC = "Imagenes/Volumen1.png"
  290. End Sub
  291.  
  292. Sub VolumenIMG_OnMouseOut
  293. VolumenIMG.SRC = "Imagenes/Volumen0.png"
  294. End Sub
  295.  
  296. Sub VolumenIMG_OnClick
  297. If Vol.Value = "si" then
  298. SonidosAmbiente.Volume = "-10000"
  299. SonidosJuego.Volume = "-10000"
  300. Vol.Value = "no"
  301. Else
  302. SonidosAmbiente.Volume = "0"
  303. SonidosJuego.Volume = "0"
  304. Vol.Value = "si"
  305. End If
  306. End Sub
  307.  
  308. Sub Volver
  309. Set WshShell = CreateObject("WScript.Shell")
  310. If JugadorUnoPTXT.Value > 9 or JugadorDosPTXT.value > 9 Then
  311. Return = WshShell.Run("VolverAJugar.vbs", 1, False)
  312. Self.Close
  313. End If
  314. End Sub
  315.  

FUENTE: FORO CODE-MAKERS

http://www.twitter.com/FTRinaldi
http://www.Facebook.com/John1Connor
http://foro.code-makers.com


En línea

dato000


Desconectado Desconectado

Mensajes: 3.034



Ver Perfil
Re: VBScript: Angry Birds Pong in VBScript [HTA + VBS] (100% Notepad) by JohnConnor
« Respuesta #1 en: 4 Marzo 2013, 23:34 pm »

Hey nada mal, para ser angry birds, nada mal.

Viejo para un novato en tema de desarrollo de juegos, puedo preguntarte algo de forma franca, estoy estudiando (con poco exito, mucho estudio me quita el tiempo para esto) como hacer un tetris en c++ y allegro, tu que dices, hacer juegos con esta libreria si rinde frutos?

tu usas Visual Basic, no me gusta tanto, prefiero C#, pero mi pregunta es: como puedo iniciarme en estos temás??

Dicho sea de paso, sigue con el trabajo, una felicitación de vez en cuando llega y motiva, y tu vas bien.


En línea


Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Nueva actualización de Angry Birds Rio
Noticias
wolfbcn 0 2,383 Último mensaje 8 Junio 2011, 17:34 pm
por wolfbcn
¿Por qué jugar a Angry Birds crea adicción? « 1 2 »
Noticias
wolfbcn 15 7,305 Último mensaje 26 Septiembre 2011, 21:21 pm
por eat7herich
Los ciberdelincuentes se fijan en Angry birds
Noticias
wolfbcn 0 1,812 Último mensaje 23 Septiembre 2011, 14:44 pm
por wolfbcn
PONG Game - Simple Juego "Pong" [VBScript + HTA] (100% Notepad)
Scripting
JohnConnor 0 4,980 Último mensaje 22 Febrero 2013, 19:07 pm
por JohnConnor
Invasion Espacial 2.0 en VBScript [VBS + HTA] 100% Notepad!
Scripting
JohnConnor 0 1,995 Último mensaje 28 Mayo 2014, 05:49 am
por JohnConnor
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines