Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI-Nspire => Topic started by: njaddison on December 12, 2011, 03:47:31 pm

Title: Lua Galaga Progress
Post by: njaddison 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:
(http://i42.tinypic.com/fz53r5.gif)
We'll be finished soon!
Title: Re: Lua Galaga Progress
Post by: DJ Omnimaga 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
Title: Re: Lua Galaga Progress
Post by: cyanophycean314 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!
Title: Re: Lua Galaga Progress
Post by: Nick 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..)
Title: Re: Lua Galaga Progress
Post by: ztrumpet on December 12, 2011, 06:02:59 pm
That looks amazing!  Excellent work on the sprites alone. Good luck!
Title: Lua Galaga Progress
Post by: 3rik 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:

(http://img.removedfromgame.com/imgs/missiles demo.gif)

Thank you for your interest in our project.
Title: Re: Lua Galaga Progress
Post by: Nick 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!
Title: Re: Lua Galaga Progress
Post by: 3rik 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.
Title: Re: Lua Galaga Progress
Post by: Adriweb 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 ?
Title: Re: Lua Galaga Progress
Post by: cyanophycean314 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!
Title: Re: Lua Galaga Progress
Post by: DJ Omnimaga 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.
Title: Re: Lua Galaga Progress
Post by: Adriweb 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.
Title: Re: Lua Galaga Progress
Post by: cyanophycean314 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?
Title: Re: Lua Galaga Progress
Post by: Adriweb on December 27, 2011, 06:56:24 am
You can find my BreakOut game here :
https://github.com/adriweb/Nspire-BreakOut (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)
Title: Re: Lua Galaga Progress
Post by: cyanophycean314 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!
Title: Re: Lua Galaga Progress
Post by: Adriweb on December 27, 2011, 02:06:01 pm
Then when the bullet has hit, you can erase the data while keeping the object, so then you can reuse it later.
Just delete the object since you have its ID and create another :)
Title: Re: Lua Galaga Progress
Post by: 3rik on December 28, 2011, 12:52:07 am
Hello everyone! I missed a lot of posts.

I was using a system much like the one adriweb was proposing. I have classes with all the necessary data and methods for each object type. Then when I create a new instance of the class, I store it to a table. When each missile moves, I check to see if it is touching any enemy object. If it is, a method is called which in this case, deletes both the enemy and the missile. In the future, it will probably trigger an explosion animation too.

The scrolling will be skippable. I just wanted to emphasize that this was a demo and not the final product yet.

I hope every one had a happy holiday season this year!
Title: Re: Lua Galaga Progress
Post by: DJ Omnimaga on December 30, 2011, 06:13:19 pm
Welcome back 3rik :) Good luck on this game.
Title: Re: Lua Galaga Progress
Post by: njaddison on January 03, 2012, 05:40:03 pm
3rik, is this how I add  the userbar?
(http://userbars.removedfromgame.com/ub/3rik383.png) (http://ourl.ca/14475.new#new)
Title: Re: Lua Galaga Progress
Post by: Nick on January 03, 2012, 05:42:16 pm
lol
better place it in your signature, otherwise you'll have to copy it everywhere xp
just go to profile > Forum Profile Information, Look and Layout and paste that link you pasted here in the signature box