Author Topic: Pacman Nspire  (Read 32803 times)

0 Members and 2 Guests are viewing this topic.

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: Pacman Lua
« Reply #15 on: July 09, 2011, 05:01:44 pm »
Yes, I follow you :)
My point is (in game applications, with many graphics), redrawing every time the screen when you change something, can be quit slow. That is why I only redraw a part and change only a couple of images. I'm absolutely sure this is faster, but I haven't done test to find the exact speed.

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: Pacman Lua
« Reply #16 on: July 09, 2011, 05:08:46 pm »
In Bobby Carrot, everything is redrawn I think, and it's not slow :P

Maybe it's because on a CX...
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: Pacman Lua
« Reply #17 on: July 09, 2011, 05:10:32 pm »
That partially because he moves in big chunks. In my game, the player moves very smooth, which makes that I need many redraws.

Offline p2

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 849
  • Rating: +51/-11
  • I'm back :)
    • View Profile
Re: Pacman Lua
« Reply #18 on: July 10, 2011, 03:45:00 pm »
With sounds?

with the pacman-melody?
or with the tetris-melody?

I think it would be better with the tetris-theme-melody.



Spoiler For Spoiler:

19 von 20 Stimmen in meinem Kopf sagen, ich bin verrückt.
die 20ste summt gerade die Tetris-melodie.

You can't understand this nice text  ;D
*insert supercool signature*

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: Pacman Lua
« Reply #19 on: July 10, 2011, 03:49:45 pm »
Currently sound isn't the most easy thing to do. It is possible, but requires lots of programming work and possibly some hardware work (like adding a resistor after the output).

Offline pianoman

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 426
  • Rating: +24/-0
  • ♪♫ ♪♫ ♪♫ ♪♫ ♪♫ ♪♫ ♪♫
    • View Profile
Re: Pacman Lua
« Reply #20 on: July 10, 2011, 05:00:53 pm »
Yeah, sorry, p2, but no sound :(
As for the platform.window:invalidate(), it is quite concievable that using parameters makes the game faster. More tests would be needed to figure that out, and if there was a plan to figure that out, I would be happy to help in any way I could.
However, I will need to be refreshing many things at once, so for this, it's sort of a moot point. Thanks anyways! :)
« Last Edit: July 10, 2011, 08:42:05 pm by pianoman »

Offline Loulou 54

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 165
  • Rating: +39/-0
    • View Profile
    • Mes programmes sur TI bank.
Re: Pacman Lua
« Reply #21 on: July 22, 2011, 07:09:28 pm »
That's not really the topic, but we can play sounds with Lua ??  O.O
Some of my program available here.. :)
http://ti.bank.free.fr/index.php?mod=archives&ac=voir2&id=1471

     

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: Pacman Lua
« Reply #22 on: July 23, 2011, 02:54:54 am »
Loulou, nice to see you here on Omnimaga :D

I have playing around with the serial port on the nspire, and by sending large chunks of data to it (using print), you can make some sound. The problem is that you can't do anything while it is busy :/
Or ... you can hook up an arduino, and let that do the sound processing :)

Offline Loulou 54

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 165
  • Rating: +39/-0
    • View Profile
    • Mes programmes sur TI bank.
Re: Pacman Lua
« Reply #23 on: July 23, 2011, 09:42:38 am »
Nice :) But how do you choose which characters to send with "print" to get the note you want ?

And do you know how are sent the data on the two ports ?
Thank you ! :)
Some of my program available here.. :)
http://ti.bank.free.fr/index.php?mod=archives&ac=voir2&id=1471

     

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: Pacman Lua
« Reply #24 on: July 23, 2011, 02:57:23 pm »
Well, you need to think how the character looks in binary, and try to make waveforms with it. Not so easy, but I'll try to make a simple library one of these days to make it simple :)

You can only send data with one port on the serial port, as the other one is input (you can't use it in Lua)

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Pacman Lua
« Reply #25 on: July 24, 2011, 09:22:44 am »
Currently sound isn't the most easy thing to do. It is possible, but requires lots of programming work and possibly some hardware work (like adding a resistor after the output).

Which is useless for the contest, because not all the judges can do it :)
« Last Edit: July 24, 2011, 09:22:56 am by ephan »

Offline Loulou 54

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 165
  • Rating: +39/-0
    • View Profile
    • Mes programmes sur TI bank.
Re: Pacman Lua
« Reply #26 on: July 24, 2011, 09:44:44 am »
Thank you Jim. :) D'you know what's the speed of the transmission ?
Could you give me an example which plays a note ?  ;D
« Last Edit: July 24, 2011, 09:45:43 am by Loulou 54 »
Some of my program available here.. :)
http://ti.bank.free.fr/index.php?mod=archives&ac=voir2&id=1471

     

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: Pacman Lua
« Reply #27 on: July 24, 2011, 04:33:44 pm »
The speed is 115200 baud.
I'll try to make a little example soon :)

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Pacman Lua
« Reply #28 on: July 24, 2011, 04:51:31 pm »
The speed is 115200 baud.
I'll try to make a little example soon :)

Oh and if it requires a system (with hardware and stuff) please post the scheme :)

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: Pacman Lua
« Reply #29 on: July 25, 2011, 09:10:50 am »
Here is the example I promised : http://ourl.ca/12233.new#new
« Last Edit: July 25, 2011, 09:11:09 am by jimbauwens »