Begin 4

Let's make some video games!

Moderator: Ice Cream Jonsey

User avatar
AArdvark
Posts: 17734
Joined: Tue May 14, 2002 6:12 pm
Location: Rochester, NY

Re: Begin 4

Post by AArdvark »

Pretend I'm really dumb for a minute. I installed Love and I downloaded the folder with all the begin files in it. How do I make the game go? All the stuff I tried results in errors. This is not my milieu, Im a grunting machinist

User avatar
pinback
Posts: 17848
Joined: Sat Apr 27, 2002 3:00 pm
Contact:

Re: Begin 4

Post by pinback »

Image

Now you can drag the windows around! I decided to use the one from earlier for... well, you know.
Am I a hero? I really can't say. But, yes.

User avatar
pinback
Posts: 17848
Joined: Sat Apr 27, 2002 3:00 pm
Contact:

Re: Begin 4

Post by pinback »

AArdvark wrote: Sun Dec 19, 2021 12:27 pm Pretend I'm really dumb for a minute. I installed Love and I downloaded the folder with all the begin files in it. How do I make the game go? All the stuff I tried results in errors. This is not my milieu, Im a grunting machinist
If Love is installed and in your path, go to the folder with main.lua in it (the main folder) and type "love ."

Or go to the directory above the begin4 directory and type "love begin4".
Am I a hero? I really can't say. But, yes.

User avatar
AArdvark
Posts: 17734
Joined: Tue May 14, 2002 6:12 pm
Location: Rochester, NY

Re: Begin 4

Post by AArdvark »

Ah ha, a text line command! I need to open a text window. I've been trying to run it using drag and drop or the Open With interface...

User avatar
AArdvark
Posts: 17734
Joined: Tue May 14, 2002 6:12 pm
Location: Rochester, NY

Re: Begin 4

Post by AArdvark »

Ah ha! I just needed to drag the whole folder onto the love application. Am trying it now. Thank you!

User avatar
pinback
Posts: 17848
Joined: Sat Apr 27, 2002 3:00 pm
Contact:

Re: Begin 4

Post by pinback »

Yeah, you're meant to package it up into a nice executable you can pass around at the end. This is still in v0.00000000001 mode.
Am I a hero? I really can't say. But, yes.

User avatar
AArdvark
Posts: 17734
Joined: Tue May 14, 2002 6:12 pm
Location: Rochester, NY

Re: Begin 4

Post by AArdvark »

Well the Bling-ons are kicking my Kirk ass all over space. If the AI gets better I'll never save the galaxy

User avatar
pinback
Posts: 17848
Joined: Sat Apr 27, 2002 3:00 pm
Contact:

Re: Begin 4

Post by pinback »

Not much to show today, as most of the work was struggling to get the windows to work right, but hey, now we got our first (drag-and-droppable) stat panel!

Image
Am I a hero? I really can't say. But, yes.

User avatar
Ice Cream Jonsey
Posts: 30065
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

Re: Begin 4

Post by Ice Cream Jonsey »

Are there phasers AND photon torpedos?
the dark and gritty...Ice Cream Jonsey!

User avatar
pinback
Posts: 17848
Joined: Sat Apr 27, 2002 3:00 pm
Contact:

Re: Begin 4

Post by pinback »

Soon!? I keep getting distracted with little side exercises like the drag and drop windows and code cleanup, but hopefully will get back to game content at some point.

Lua is such a fun language and Love such a fun framework, I just find knocking out any ticket at all enjoyable and rewarding.
Am I a hero? I really can't say. But, yes.

User avatar
Tdarcos
Posts: 9529
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Re: Begin 4

Post by Tdarcos »

pinback wrote: Sun Dec 19, 2021 1:45 pm
AArdvark wrote: Sun Dec 19, 2021 12:27 pm How do I make the game go?
If Love is installed and in your path, go to the folder with main.lua in it (the main folder) and type "love ."

Or go to the directory above the begin4 directory and type "love begin4".
It figured eventually someone would get around to asking Pinback "how to make love work."

At least it wasn't a statement that it was in source form and you had to "make love clean". In that case, you're really screwed!
"Baby, I was afraid before
I'm not afraid, any more."
- Belinda Carlisle, Heaven Is A Place On Earth

User avatar
AArdvark
Posts: 17734
Joined: Tue May 14, 2002 6:12 pm
Location: Rochester, NY

Re: Begin 4

Post by AArdvark »

Yeah, he's back....

User avatar
AArdvark
Posts: 17734
Joined: Tue May 14, 2002 6:12 pm
Location: Rochester, NY

Re: Begin 4

Post by AArdvark »

Is there a way to make my ship go as fast as the enemy ships? Not only outnumbered but way too slow to avoid getting spaced every time. How will this be turn based, each of the ships get a turn to plot in a location and/or firing solution?

THE
FIRE ONE
AARDVARK

User avatar
pinback
Posts: 17848
Joined: Sat Apr 27, 2002 3:00 pm
Contact:

Re: Begin 4

Post by pinback »

1. The speeds and stuff are nowhere near final, and were just random numbers to validate the movement mechanic. Nothing about this is what it's going to be, except for maybe some of the graphics. None of it.
2. It will be pausable real-time, as it is now. It's paused, and then you hold down the space bar (or press on a button which doesn't exist yet), and things will move. If you want to change your plans, you let go of the spacebar to pause and give commands.
Am I a hero? I really can't say. But, yes.

User avatar
AArdvark
Posts: 17734
Joined: Tue May 14, 2002 6:12 pm
Location: Rochester, NY

Re: Begin 4

Post by AArdvark »

Well I beat the Kobebeef-Maroon scenario, sort of. You can simply fire a bazillion tinkertoy torpedoes and just swarm all three ships at once. One of them ran off the screen and I couldn't see it anymore, so that counts as a win if I make them run away, right?. it gets really slow having to track all those torpedoes at once though, perhaps remove them if they miss so the screen doesn't have to keep tracking them? Now it's getting fun!

User avatar
pinback
Posts: 17848
Joined: Sat Apr 27, 2002 3:00 pm
Contact:

Re: Begin 4

Post by pinback »

That was literally the next thing on my Asana to-do list, believe it or not.

Right, so in the real game, it takes time to load your torpedo tubes, so you can't just spam away. Like I says, the current state of the game has little to do with the game.
Am I a hero? I really can't say. But, yes.

User avatar
pinback
Posts: 17848
Joined: Sat Apr 27, 2002 3:00 pm
Contact:

Re: Begin 4

Post by pinback »

As requested, torpedoes now have a "duration", after which they will fade into existence. The hardcoded duration is "5", meaning if you hold the spacebar down, they should die in five seconds. Instead, they die in about 8. Let me explain why, for anyone interested in how this stuff works.

I have it set to do a specific number of things per second. I call them "cycles". As the code exists in git now, this number is set to 50. So ideally it would do exactly 50 cycles per second.

The way Love works, though, is, it will call your code every frame, and will call it with the number of seconds that have elapsed since the last frame. This is so if you want to maintain consistent gameplay, and you wanted to have something happen once per second, you can use this to make sure things don't happen faster on a high-end computer than a low-end computer. So for your once-per-second thing, you'd do something like this:

Code: Select all

totaltime = 0
function love.update(dt)  -- "dt" here is the elapsed time in seconds since the last frame, ex, ".014".
   totaltime = totaltime + dt
   if totaltime > 1 then   -- If 1 whole second has elapsed
      doSomething()
      totaltime = 0    -- reset this variable so you can start counting up to 1 again
   end
end
The thing is here, there is going to be some bleed-over, because totaltime is probably never going to be exactly zero. If totaltime was 1.04 once it got over 1, then when you reset it, you're going to have "lost" those 4/100ths of a second.

This is how I wrote the code, except instead of counting up to a second, it's counting up to 1/50th of a second, so we can do 50 things per second. The bad thing here is, this gives it 50 chances to "bleed over", so we're losing a lot of fractional seconds, which is why five seconds magically become about 8, as the code exists now.

A FIX APPEARS?!

Let's see if we can fix that. I'm thinking, instead of just discarding that bleed-over, we can add it back to "totaltime" once we reset it to zero, so we haven't lost that little bit of extra time. For the above code, the fix would look like this:

Code: Select all

totaltime = 0
function love.update(dt)  -- "dt" here is the elapsed time in seconds since the last frame, ex, ".014".
   totaltime = totaltime + dt
   if totaltime > 1 then   -- If 1 whole second has elapsed
      doSomething()
      totaltime = totaltime % 1    -- instead of resetting to zero, reset to the remainder after you divide by one -- in other words, whatever part was over a second
   end
end
I'm going to put this in my code now, and if all goes well, the torpedoes will now die at exactly five seconds of holding down the spacebar... be right back!

...sounds of furious coding...

The torpedoes died at exactly five seconds.

God damn am I good at this. I didn't even have to look it up on Google, Paul.
Am I a hero? I really can't say. But, yes.

User avatar
AArdvark
Posts: 17734
Joined: Tue May 14, 2002 6:12 pm
Location: Rochester, NY

Re: Begin 4

Post by AArdvark »

So, and.this.is without actually yrying it yet, you have to be in a five second torpedo range in order to hit the enemy. Interesting... I hope there will be some kind of cloaking device. Like the enemy can't see you until you fire, give you a chance to get close enough.

User avatar
pinback
Posts: 17848
Joined: Sat Apr 27, 2002 3:00 pm
Contact:

Re: Begin 4

Post by pinback »

That'll be for the Romulans. Or whatever copyright-free name we can come up with for them. ROMULOIDS?!!
Am I a hero? I really can't say. But, yes.

User avatar
AArdvark
Posts: 17734
Joined: Tue May 14, 2002 6:12 pm
Location: Rochester, NY

Re: Begin 4

Post by AArdvark »

Romchip-monks!

Post Reply