Author Topic: Lua Galaga Progress  (Read 9613 times)

0 Members and 1 Guest are viewing this topic.

Offline njaddison

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 176
  • Rating: +24/-27
    • View Profile
Lua Galaga Progress
« on: December 12, 2011, 03:47:31 pm »
guys, 3rik and I are in the phase of animating the galaga sprites. he has scripted the codes to move the spacefighter. this is a learning process for me, so i'm not much help except for animating the title screen and the game over screen, so when we are finished, I will know how to make a good game using lua. Then, we can create games much faster. Here is a gif of our progress:

We'll be finished soon!
<a href="http://www.nerdtests.com/ft_nt2.php">
<img src="http://www.nerdtests.com/images/badge/nt2/5f42ec78e054645d.png" alt="NerdTests.com says I'm a Highly Dorky Nerd God.  Click here to take the Nerd Test, get geeky images and jokes, and talk to others on the nerd forum!">
</a>


Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Lua Galaga Progress
« Reply #1 on: December 12, 2011, 04:07:33 pm »
Looks pretty nice so far. FOr some reasons though I misread the title as Lady Gaga Progress O.O

Can't wait to see gameplay of the game. Good luck :D

Offline cyanophycean314

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 363
  • Rating: +43/-1
  • It's You!
    • View Profile
Re: Lua Galaga Progress
« Reply #2 on: December 12, 2011, 04:58:19 pm »
Very pretty. Want play. It looks like it's going to be an authentic version.

Good luck!

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: Lua Galaga Progress
« Reply #3 on: December 12, 2011, 05:50:18 pm »
that is indeed looking great, nice work for your first lua game (even if it was not alone..)

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Lua Galaga Progress
« Reply #4 on: December 12, 2011, 06:02:59 pm »
That looks amazing!  Excellent work on the sprites alone. Good luck!
« Last Edit: December 12, 2011, 06:03:06 pm by ztrumpet »

Offline 3rik

  • LV3 Member (Next: 100)
  • ***
  • Posts: 92
  • Rating: +8/-0
  • My TI-84+ SE
    • View Profile
Lua Galaga Progress
« Reply #5 on: December 24, 2011, 01:53:31 am »
This week we have finished the scrolling text class and, as of today, we have completed the basics needed for the player to shoot missiles. :D The timing isn't perfect yet but that will be fixed later.

Here's an animated gif to see our progress:



Thank you for your interest in our project.
« Last Edit: December 24, 2011, 01:54:00 am by 3rik »
Userbars

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: Lua Galaga Progress
« Reply #6 on: December 24, 2011, 02:38:30 am »
looks great, although i would make the menu come another way. It looks good, but if you'll have to wait everytime to watch that öor maybe you could insert that when you press enter, it directly goed where it has to go..?

but it's nice that you have animated sprites, and the shooting seems to work perfect, so good job on this!

Offline 3rik

  • LV3 Member (Next: 100)
  • ***
  • Posts: 92
  • Rating: +8/-0
  • My TI-84+ SE
    • View Profile
Re: Lua Galaga Progress
« Reply #7 on: December 24, 2011, 02:44:53 am »
This was meant to be just a simple test to demonstrate the shooting so that I knew it would work. I could have pressed enter sooner instead of waiting until the text stopped. It's kinda hard to tell because you can't see the keys I was pressing. Also, I can always adjust the speed that the text scrolls at too.
Userbars

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: Lua Galaga Progress
« Reply #8 on: December 24, 2011, 05:00:26 am »
Looking great :)

However, it does look slow (is it the GIF, maybe ? )
How are your functions managed with on.timer ? (period == ?)

What are you redrawing on each on.paint call ?
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline cyanophycean314

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 363
  • Rating: +43/-1
  • It's You!
    • View Profile
Re: Lua Galaga Progress
« Reply #9 on: December 25, 2011, 04:48:04 pm »
When I was making a mini-shooter, I didn't know how to make multiple bullets. Each bullet is an object, but how would you implement that?

I see that you clearly have multiple bullets. Nice job!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Lua Galaga Progress
« Reply #10 on: December 25, 2011, 10:20:55 pm »
Looks nice, although it would be nice if it was faster. Also an option to skip the intro.

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: Lua Galaga Progress
« Reply #11 on: December 26, 2011, 05:14:33 am »
When I was making a mini-shooter, I didn't know how to make multiple bullets. Each bullet is an object, but how would you implement that?

I see that you clearly have multiple bullets. Nice job!

The same way I did with multiple balls in BreakOut.

If you do everything object-oriented (lua's "Class()" things) it's really easy.
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline cyanophycean314

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 363
  • Rating: +43/-1
  • It's You!
    • View Profile
Re: Lua Galaga Progress
« Reply #12 on: December 26, 2011, 08:03:22 pm »
I am using objects and classes. Do I need to create multiple preset objects that are called for when the person shoots? Or can I dynamically create an object with a certain name when they press the button, thereby theoretically allowing infinite bullets possible?

Oh and where can I find your BreakOut program?

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: Lua Galaga Progress
« Reply #13 on: December 27, 2011, 06:56:24 am »
You can find my BreakOut game here :
https://github.com/adriweb/Nspire-BreakOut
(I should put some of my stuff in my signature :P)

Go read lines ≈ 207+ :

Anyway, the way I do it is indeed dynamic :

Code: [Select]
      if lives < 1 then
          gameover = true
      else
        paddle.x = 0.5*platform.window:width()-29+newPaddleY
        aBall = Ball(paddle.x,platform.window:height()-26,-1-speedDiff,-1-speedDiff,#BallsTable+1)
        table.insert(BallsTable,aBall)
        pause = true
        waitContinue = true
      end

the Ball class init is : Ball:init(x, y, speedX, speedY, id)
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline cyanophycean314

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 363
  • Rating: +43/-1
  • It's You!
    • View Profile
Re: Lua Galaga Progress
« Reply #14 on: December 27, 2011, 12:11:34 pm »
Ok. So basically you have a table of objects and then each time you shoot, you would basically add an object to that table.

Then when the bullet has hit, you can erase the data while keeping the object, so then you can reuse it later.

Thanks!