Author Topic: Pacman Nspire  (Read 32800 times)

0 Members and 1 Guest are viewing this topic.

Offline pianoman

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 426
  • Rating: +24/-0
  • ♪♫ ♪♫ ♪♫ ♪♫ ♪♫ ♪♫ ♪♫
    • View Profile
Pacman Nspire
« on: July 08, 2011, 01:35:13 pm »
Hi, everyone!
I figured it was time that this game came to the nspire in Lua, so I decided to start it.
I'm still working on the movement of Pacman and the ghosts, but I thought it through, and it seems like it would be possible.
If anyone would like to attach any maps (not too big), I might use them in the game.
That would be very helpful.
I'll keep you all posted (pun intended) on progress.
Thanks!

Offline Stefan Bauwens

  • Creator of Myst 89 - סטיבן
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1799
  • Rating: +162/-24
  • 68k programmer
    • View Profile
    • Portfolio
Re: Pacman Lua
« Reply #1 on: July 08, 2011, 01:53:04 pm »
Good Luck!


Very proud Ticalc.org POTY winner (2011 68k) with Myst 89!
Very proud TI-Planet.org DBZ winner(2013)

Interview with me

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 #2 on: July 08, 2011, 02:33:19 pm »
Good luck pianoman!

I know its kinda hard to make this game in Lua, because you will need to do lots of calculations and screen refreshes, so I hope that it will work out!

Offline pianoman

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 426
  • Rating: +24/-0
  • ♪♫ ♪♫ ♪♫ ♪♫ ♪♫ ♪♫ ♪♫
    • View Profile
Re: Pacman Lua
« Reply #3 on: July 08, 2011, 02:34:28 pm »
Thanks! It will be a lot of screen refreshes, but I suppose that's one advantage of event-based languages :)

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: Pacman Lua
« Reply #4 on: July 09, 2011, 08:23:47 am »
Sounds cool, and like it might work decently for Lua. Question: are you going to have stages full screen or are you going to allow them to be larger than the screen and scroll (this would be relevant for people making stages for you :))? Personally, I think it might be easier if you just do them full screen and avoid scrolling.
« Last Edit: July 09, 2011, 08:24:35 am by Art_of_camelot »

Offline pianoman

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 426
  • Rating: +24/-0
  • ♪♫ ♪♫ ♪♫ ♪♫ ♪♫ ♪♫ ♪♫
    • View Profile
Re: Pacman Lua
« Reply #5 on: July 09, 2011, 12:33:27 pm »
Yeah, I was planning on full screen.
I might open up a thread on that later. :P

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: Pacman Lua
« Reply #6 on: July 09, 2011, 12:36:20 pm »
About the screen refresh, don't forget the optional parameters of platform.window:invalidate()

( platform.window:invalidate([x, y, width, height]) )

That refreshed only the part of the screen you want ;)



PS : avoiding scrolling is always easier and faster to do :P
« Last Edit: July 09, 2011, 12:37:09 pm by adriweb »
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline pianoman

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 426
  • Rating: +24/-0
  • ♪♫ ♪♫ ♪♫ ♪♫ ♪♫ ♪♫ ♪♫
    • View Profile
Re: Pacman Lua
« Reply #7 on: July 09, 2011, 12:41:56 pm »
Yeah, I'll be using oclua to test out some stuff like that before i hit the computer with it :P

Offline apcalc

  • The Game
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1393
  • Rating: +120/-2
  • VGhlIEdhbWUh (Base 64 :))
    • View Profile
Re: Pacman Lua
« Reply #8 on: July 09, 2011, 01:25:44 pm »
This sounds quite interesting, I wish you the best of luck with development on this project! :)


Offline Levak

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1002
  • Rating: +208/-39
    • View Profile
    • My website
Re: Pacman Lua
« Reply #9 on: July 09, 2011, 02:06:11 pm »
About the screen refresh, don't forget the optional parameters of platform.window:invalidate()

( platform.window:invalidate([x, y, width, height]) )

That refreshed only the part of the screen you want ;)


This hasn't been tested as a bench, but I don't think that it's as faster as without argument.
There is two way of mind :

 - The on.paint(gc) is the user part of drawing the screen. Thus, the concerned shapes are drawn with a condition in all the gc:draw/fill routines. That will slow the entire process with a, most of the time, useless condition.

 - The on.paint(gc) fills the entire buffer without condition. When there is a specified condition, we apply a fusion mask to overlay the new buffer with the old screen. This is even faster when there is no condition, slower when there is one.

Thus, two ways of mind that have their avantages. I think a full bench will reveal which method is used, but I'm pretty sure it is the second one, so it is slower to draw a specified part of the screen.
I do not get mad at people, I just want them to learn the way I learnt.
My website - TI-Planet - iNspired-Lua

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: Pacman Lua
« Reply #10 on: July 09, 2011, 02:22:39 pm »
Well we'd have to test that :)

But then why would TI do such a thing ... ><
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 #11 on: July 09, 2011, 03:38:35 pm »
Well, I'm developing a game (not saying the name :p) and the extra parameters are really important for me. Now I don't need to redraw all the images on the screen using gc:drawImage (which is slow), and I notice a big speedup. The game will be unplayable without it.

Offline Levak

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1002
  • Rating: +208/-39
    • View Profile
    • My website
Re: Pacman Lua
« Reply #12 on: July 09, 2011, 04:35:08 pm »
Well, I'm developing a game (not saying the name :p) and the extra parameters are really important for me. Now I don't need to redraw all the images on the screen using gc:drawImage (which is slow), and I notice a big speedup. The game will be unplayable without it.

Ok, but have you tested without arguments to make a real bench ?
Even if I trust in you, we have to be really sure of this.
« Last Edit: July 09, 2011, 04:35:24 pm by Levak »
I do not get mad at people, I just want them to learn the way I learnt.
My website - TI-Planet - iNspired-Lua

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 #13 on: July 09, 2011, 04:53:36 pm »
Well, the thing is that I don't have to draw more images if I use this. Redrawing the screen alone might be faster, but for many games that need images, the combination will be faster. drawImage really can be a bottleneck in programs, and that is why I try to limit using it with redrawing only parts.
« Last Edit: July 09, 2011, 04:55:03 pm by jimbauwens »

Offline Levak

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1002
  • Rating: +208/-39
    • View Profile
    • My website
Re: Pacman Lua
« Reply #14 on: July 09, 2011, 04:55:59 pm »
Well, the thing is that I don't have to draw more images if I use this. Redrawing the screen alone might be faster, but for many games that need images, the combination will be faster. drawImage really can be a bottleneck in programs, and that is why I try to limit using it with redrawing only parts.

But, how can be sure of that ? The on.paint(gc) method is one unique function which cannot be defined for different part of the screen.

We have no proof, except a full bench, that the buffer is filled the same way and then superposed over the old screen, or, if the buffer is drawn locally.

Do you follow me ?
« Last Edit: July 09, 2011, 04:57:49 pm by Levak »
I do not get mad at people, I just want them to learn the way I learnt.
My website - TI-Planet - iNspired-Lua