Recent

Author Topic: Next up, Asteroids <update>  (Read 2730 times)

TBMan

  • Sr. Member
  • ****
  • Posts: 348
Next up, Asteroids <update>
« on: April 03, 2025, 01:41:09 am »
I'm preliminarily calling my clone Asteroid Battles. I'm currently tweaking the ship movement behavior. This is what I have so far.

https://www.youtube.com/watch?v=YmKlS3RPS3c
« Last Edit: April 03, 2025, 04:33:25 pm by TBMan »
Barry

Newest game (clone),
Missile Commander:
https://www.youtube.com/watch?v=tgKz0cxog-k

TBMan

  • Sr. Member
  • ****
  • Posts: 348
Re: Next up, Asteroids <update>
« Reply #1 on: April 03, 2025, 04:44:28 pm »
Here's a video of phase 2.

https://www.youtube.com/watch?v=s9mhiVeX_3E

Ship movement and firing is basically done. I may tweak the look of the ship slightly.

I've begun work on the asteroids. First I wanted to do a test with the frame animation andit looks like we're moving along well with that. Now I have to design the data framework forthe asteroids.

I would like to have different size asteroids (the size and shape would be randomly generated from (small, medium, large) and (shape1, shape2, shape3).   I'm going to see if using objects for the asteroids is best. I would avoid memory issues if I just predetermine the number of asteroids per game session and then generate them and store them in an array of the objects (or a linked list). None of the asteroids would be removed from memory, just exploded, then given a new "life" in a different shape and size, position and trajectory.
Barry

Newest game (clone),
Missile Commander:
https://www.youtube.com/watch?v=tgKz0cxog-k

TBMan

  • Sr. Member
  • ****
  • Posts: 348
Re: Next up, Asteroids <update>
« Reply #2 on: April 04, 2025, 07:43:33 pm »
And now we are at phase 3.

Real asteroids flying around that split when shot and destroyed when at the smallest size. I tweaked the ship speed as well.

https://www.youtube.com/watch?v=3VDW_4x9Slk
Barry

Newest game (clone),
Missile Commander:
https://www.youtube.com/watch?v=tgKz0cxog-k

dseligo

  • Hero Member
  • *****
  • Posts: 1671
Re: Next up, Asteroids <update>
« Reply #3 on: April 04, 2025, 09:31:27 pm »
Great work.

But it's so quiet without the sound.

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: Next up, Asteroids <update>
« Reply #4 on: April 04, 2025, 10:38:22 pm »
got you covered dseligo :D (warning, do not click when traumatized by war)
« Last Edit: April 04, 2025, 10:49:27 pm by TRon »
Today is tomorrow's yesterday.

TBMan

  • Sr. Member
  • ****
  • Posts: 348
Re: Next up, Asteroids <update>
« Reply #5 on: April 04, 2025, 11:49:59 pm »
Great work.

But it's so quiet without the sound.

Thanks, but yes it needs sound, you're right.

** edit **

I found a website with wav files to use in the game.  I'll see how it works out. Playsound stops though when another called is made to it so not sure.
« Last Edit: April 05, 2025, 01:13:53 am by TBMan »
Barry

Newest game (clone),
Missile Commander:
https://www.youtube.com/watch?v=tgKz0cxog-k

cdbc

  • Hero Member
  • *****
  • Posts: 2664
    • http://www.cdbc.dk
Re: Next up, Asteroids <update>
« Reply #6 on: April 06, 2025, 09:34:37 am »
Hi
@TBMan: Why don't you have a 'looksee' at what @Gigatron is up to, here in this forum?!?
He does a lot of cool stuff with background music...
I think it's right up your alley =^  :)
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: Next up, Asteroids <update>
« Reply #7 on: April 06, 2025, 12:58:07 pm »
Playsound stops though when another called is made to it so not sure.
Nah, please don't use that.

As a suggestion, use openal. Seems right up the alley with optional sound-distance that can be used. That is, if you are not planning on switching to a gaming engine that offers its own sound-support.

It is an external library. The basics go like:
- create audio buffer from audio-file (or memory or live generated samples)
- create sound-source(s)
- link sound-buffer to sound-source
- set details of sound-source (looping, distance, pitch, speed etc)
- Set location of listener
- Play one or multiple sources, if wanted adjust any of the details over time that can be changed.
- Stop or restart one or multiple sources from playing
- when done delete the sources and buffers for memory.
Today is tomorrow's yesterday.

TBMan

  • Sr. Member
  • ****
  • Posts: 348
Re: Next up, Asteroids <update>
« Reply #8 on: April 06, 2025, 04:15:54 pm »
Thanks everyone, I'll take a look at the suggestions.

I'm also testing out this ...

Code: Pascal  [Select][+][-]
  1. mciSendString("open waveaudio!MyFile.wav alias MyFile",NULL,0,0);
  2. mciSendString("play MyFile wait",NULL,0,0);
  3. mciSendString("close MyFile",NULL,0,0);
  4.  
  5.  
  6.  
Barry

Newest game (clone),
Missile Commander:
https://www.youtube.com/watch?v=tgKz0cxog-k

Josh

  • Hero Member
  • *****
  • Posts: 1454
Re: Next up, Asteroids <update>
« Reply #9 on: April 06, 2025, 04:19:15 pm »
something i played with a few years ago,

lots of asteroids/balls detection, bouncing, glancing off slowing down or accelerating based on size etc..

designed as a test, but may be useful.

The best way to get accurate information on the forum is to post something wrong and wait for corrections.

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: Next up, Asteroids <update>
« Reply #10 on: April 06, 2025, 05:05:57 pm »
I'm also testing out this ...
Why not use Direct-X when depending on all these Windows atrocities ?
Today is tomorrow's yesterday.

TBMan

  • Sr. Member
  • ****
  • Posts: 348
Re: Next up, Asteroids <update>
« Reply #11 on: April 06, 2025, 08:32:09 pm »
I'm also testing out this ...
Why not use Direct-X when depending on all these Windows atrocities ?

I'll look into it, thanks.

I did find out that with mcisendstring wav files that are 8 or 16 bit work. I didn't try 24 bit, but 32 bit didn't work. I do some solo acoustic guitar recordings from time to time so I have a couple of tools for sound files.
Barry

Newest game (clone),
Missile Commander:
https://www.youtube.com/watch?v=tgKz0cxog-k

 

TinyPortal © 2005-2018