Posted: 7th Sep 2011 12:32
Hey guys

I've done my first code with AppGameKit today This is a code I written several times in other languages. I would like to translate it for you.

This is a 3D fake starfield. With some maths, we create a z coordinate that is a fake one and we make a projection to show the stars like a 3D starfield.

This effect looks like amiga style

I provide you a zip file (see file attachment) in this topic, with the entire project.

Just, open it, compile it and have fun with it

Happy AppGameKit !
Posted: 7th Sep 2011 15:18
Love it! Takes me back to the 1980s and playing Star Raiders.

Great to see how fast you made this since you only had AppGameKit 1 day!

Rick
Posted: 7th Sep 2011 15:33
Thank you

Yes but I know this snippet because I code it in other language, first in pure, and on xna, etc... So, to start learning AppGameKit, I tries to translate my code on it

This is inspired from a code I found several years ago (may be 10 years ago now) that was for a language I doesn't remember the name. I have re-wrote and personalized it for my personnal uses, and now, this snippet follows me everywhere

I'm happy if you love it

Thx !

PS : sorry for my aproximate english lol
Posted: 7th Sep 2011 17:53
Could you post an screenie of the star field ?

Will probably download it later on and check it out
Posted: 7th Sep 2011 19:53
I can try to make a screenie of it, but in fact you will see just a starfield with small flare sprite. The aim of the code is the movement that simulate a depth.

So it's difficult to show the result with a screenie
Posted: 7th Sep 2011 20:04
Thanks Crystal Noir

This gives me something to play with. I haven't done much of anything since I bought it.

Dennis W
Posted: 9th Sep 2011 16:53
lol SWEETNESS!

I added a thruster...


      if GetPointerState() = 1
            speed# = speed# + 0.01
            if speed# > 1.9 then speed# = 1.9
      else
            speed# = speed# - 0.01
            if speed# < 0.01 then speed# = 0.01
      endif

...use the left mouse button to thrust.


Could you post a screenie of the starfield?


Here is a video that shows his example with the thruster effect thrown in ...
Posted: 9th Sep 2011 20:26
To give it a bit of polish, although I suspect it cant be good for performance, add the following straight after the SetSpritePosition command (line 62) to fade the stars from far to near....

+ Code Snippet
SetSpriteColorAlpha( starfield[i].id, 255-starfield[i].z# )
Posted: 9th Sep 2011 23:58
Here's another version modified for some mouse movement. You wouldn't have originally got it from a Blitz Basic website would you? I published starfield code based on this a number of years ago.
But it is pretty common so prob not mine
Posted: 11th Sep 2011 13:01
I added a hud see pic Some one like to add meteors or laser

Dennis W
Posted: 11th Sep 2011 13:06
Here is the zip

Dennis W
Posted: 11th Sep 2011 18:36
lol
These modifications are really cool guys.
If we keep it up this will end up being a game instead of just an example of a starfield.
Here is my latest mod, in which I added side movement, but I used a different approach than Euphoria. (I stayed with Crystal Noir's orginial variables)
I also added a virtual joystick.
Up = speed up
Down = slow down
Right = bank right
Left = bank left
Posted: 11th Sep 2011 20:37
Happy that my first snippet make you create some things with !

Very cool modifications
Posted: 11th Sep 2011 22:40
I could not help it, had to make my own mod...



Sources attached.
Posted: 13th Sep 2011 17:37
I could not help it

Yes you could!

I added a hud

Very nice!

I did one too... see attached
I decided to build a space shooter based off of this.
Posted: 13th Sep 2011 17:42
Use this bit for the space section and my Hot Lap engine for the trench section and you're not far from a Star Wars remake!
Posted: 13th Sep 2011 18:02
@Conjured Entertainment

Make sure its small. AppGameKit has a number of significant bugs including one that means you cannot write large programs (Teir 1) at the moment, not to mention it is not adhering to its 'Deploy effortlessly to multiple platforms' statement. Waiting for things to be fixed up before spending anymore time on it.

Good luck with the shooter
Posted: 14th Sep 2011 2:12


Make sure its small.

Okay, I'll make sure to use less enemies than stars.

AGK has a number of significant bugs including one that means you cannot write large programs (Teir 1) at the moment, not to mention...

Okay, I won't mention it then, and I'll make sure to remember that AppGameKit is not unlimited.

Waiting for things to be fixed up before spending anymore time on it.

You do that then, but I have to get #3 finished.

Thanks for the advice.

Edit
My recent additions...
A minimap that has the players ship so far, which still needs some tweaking on the turns, is at the top.
I also made an indicator for the ship's force field shield, which will disappear as the shield's enery goes down.
Posted: 18th Sep 2011 3:53
Wow I love this thread. Kinda like one of those story threads but cooler. I think I'll grab this and make a Star Trek arcade game clone.
Posted: 18th Sep 2011 14:47
I think I'll grab this and make a Star Trek arcade game clone.

I never remembered those stars being like that, but the ones in the background are interesting.
I may have to modify the starfield now to get that effect, because I am lacking the realism of the turns.
Nice video, and good luck with your project.


I have installed a homing device on my enemy ships for the minimap.
They now home in on the players ship, so all I have to do is work out the FPS view of the ships and get the weapons going.
Then, it is on to the display of the ammo and counters.
I'll add in my sound effects last.
Maybe TGC will have the publishing in place by the time I finish this one, because it will be awhile before I finish.
The real world has once again spoiled my plan, so I have to take a 1 week break from AGK.