Log In  

Cart [#fedoyofare-19#] | Code | 2019-08-18 | License: CC4-BY-NC-SA | Embed
14

Enjoy my final release revision 2.9!

Changed the map to random generation.
Larger map and performance improvement.

fixed some bugs, grow the title and simplified some functions in the code!

2019-04-26 update: add attract demo mode for arcade vibe!

2019-08-12 updates, back to tiled map with the map wrap!!
special thanks to @dw817 I give him credits for wrap map code help! :)
fixed collision algorithm too.

P#62245 2019-02-25 17:12 ( Edited 2019-08-18 15:46)

Pretty good but I feel like the map is too small.

P#62697 2019-03-09 01:28
1

updated, real random mountain and larger map, 5 digits score displays!

P#63480 2019-04-13 18:38
:: dw817

Original Defender and Stargate (successor) allow you to wrap map. Also the game was pretty neat because you =DID= save the humans. That was the interesting idea there.

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

P#66527 2019-08-10 23:37

@dw817

Thanks, if only someone know the coding trick to wrap the map in pico-8 that should be thanksfull!

P#66538 2019-08-11 04:16
:: dw817
1

That's no trick. Let's see, for PICO-8 that would be ...

Cart [#fazamayuhe-0#] | Code | 2019-08-11 | No License | Embed
1

-- simple wrap-map example
-- written by dw817

cls()
y=7
for i=0,127 do
  repeat
    c=0
    ok=0
    r=flr(rnd()*3)
    if (i-113>(7-y) and y<7) r=2
    if (i==127 and y==7) r=1
    if (r==0 and y>0) or r==1 or (r==2 and y<7) then
      if (r==0) y-=1 c=1 ok=1
      if (r==1) c=2 ok=1
      if (r==2) c=3 ok=1
      mset(i,y+8,c)
      if (r==2) y+=1
    end
  until ok==1
end
x=0 y=0
repeat
  cls()
  camera()
  print("x="..x.." y="..y)
  camera(x,y)
  map()
  map(0,0,1024)
  flip()
  s=1
  if (btn(🅾️)) s=8
  if (btn(⬅️)) x-=s
  if (btn(➡️)) x+=s
  x=x%1024
until forever

Hold down (O) to speed up scrolling.

The tricky code here:

if (i-113>(7-y) and y<7) r=2
if (i==127 and y==7) r=1

is to ensure the wrapping edge also starts at the bottom.

HOPE THIS HELPS !

P#66548 2019-08-11 15:41 ( Edited 2019-08-11 16:02)

@dw817 Brilliant! Usefull for the first Gorg's version when i used a tilemaped hills... the last one uses lines draws from a points table.

thanks! I follow ya. :)

This is the version i made with your Wrap map code. Looks like I got a clipping problem when intersect map boundary. Seems like the draw_hud function slow down things.

Cart [#nafotikigi-0#] | Code | 2019-08-11 | No License | Embed

P#66555 2019-08-11 18:04 ( Edited 2019-08-11 22:20)
:: dw817

Yep. A clipping problem. Let me see ...

Think I fixed it.

Add:

map(0,0,-1024)

beneath your:

map()

and that oughta get it.

You might tighten up your collision check. Seems like if you just get in the airspace of an enemy, the player collides anyways. While there is no pixel-per-pixel routine like COLLIDE() for PICO YET, you should be able to give the player a bit more breathing room since their ship is short vertically.

P#66584 2019-08-11 23:26 ( Edited 2019-08-11 23:26)
:: dw817

Tried a few other things.

Cart [#kasigibuga-0#] | Code | 2019-08-12 | No License | Embed

Modified it so if you are traveling left and press right, you stop instantly. Also traveling right, press left, stop instantly.

Changed the speed of the player so starting to accelerate takes twice as long to reach full speed.

if btn(⬅️) then
  if (player.spd>0) player.spd=0
  player.spd-=0.05
  player.flp=true
elseif btn(➡️) then
  if (player.spd<0) player.spd=0
  player.spd+=0.05
  player.flp=false
end

Modified the cannon so if held it shoots only sporadically, encouraging the player to time their individual shots.

if btn(🅾️) or btn(❎) then
  btnr=flr(rnd()*16)+8
  if btntime%btnr==0 then
    lazer_init()
    btntime+=1
  end
  btntime+=1
else
  btntime=0
end

Noticed both the stars and mountains appeared in front of the player, changed the order of display so they appear behind the player's ship.

See if this helps player and visual control. :)

P#66619 2019-08-12 18:54 ( Edited 2019-08-12 19:08)

@dw817

Great job....I put ya on the credits :)

Notice that the game background appear on title state
Should be a nice idea!

P#66627 2019-08-12 20:35 ( Edited 2019-08-12 20:41)
:: dw817
1

Glad to help. I remember spending many a good quarter on Defender.

All you have left now is sound effects and recording high-score to load & save if you want.

P#66630 2019-08-12 22:04

@dw817 I notice that we can also use the random the old way wu used in 80's BASIC

btnr=flr(rnd()*16)+8

that remembered me that old:

x=int(rnd()*16)+8 :)

P#66643 2019-08-13 14:32 ( Edited 2019-08-13 16:43)
:: dw817

Yep, BG ... I'm trying to remember. Right, you can do this in Blitz:

r=rnd(1,6)

To give you a random number from 1 to 6. You can't do that in PICO though.

Maybe something the ZEP can add in an update ?

P#66648 2019-08-13 17:28

@dw817 by the way this was the original GORGon on Apple II.

P#66758 2019-08-18 15:39
:: dw817

I wasn't going to mention that Apple ][ game until I found the one I was searching to compare it with - which I haven't yet. It's really more along the lines of what you have here.

It's Defender, yes, but you shoot targets only, no rescue, yet it looks like Defender. Do you know this game for the Apple ][ ?

Oh, and I don't know if this is any faster. You can get random number using this:

r=flr(rnd(n))

Where the random number you want is 0 to (n-1).

Also there is:

r=flr(rnd(-1)%n))

Here is what I have been using, which may not be any faster:

r=flr(rnd()*n)

Suggest ZEP give you a forced and seeded # when you use any number greater than zero for rnd() and if you choose rnd(-1) or rnd(), then it goes back to unseeded automatically.

P#66761 2019-08-18 16:12 ( Edited 2019-08-18 16:20)

@dw817 yes this game is GORGON from sirius Software on the Aplle II...hmm out in 1981 or 1983. A defender clone with the twist of limited fuel where you have to raise up in space, pass trhu satellites to fill up your fuel with the mothership (USS enterprise) and back to the game on the planet.

P#66823 2019-08-21 04:01
:: dw817

Still not the game I'm thinking of though. I have a little over 1400 Apple games here. Going through them slowly and finding old gems, but still not the game I'm thinking of.

I'll let you know when I find it.

P#66825 2019-08-21 04:06

@dw817 Gorgon roms for the emulator dowload link, if you got the AppleWin emulator.....

https://apple2online.com/web_documents/Gorgon%20A2OL.zip

P#66920 2019-08-24 19:11
:: dw817

Thanks, but no, BGelais. I have the Gorgon game. That's not it. There was a DIFFERENT Apple ][ game that was more like yours. Still haven't found it.

Appreciate the link tho.

P#66921 2019-08-24 19:44

[Please log in to post a comment]

About | Contact | Updates | Terms of Use
Follow Lexaloffle:        
Generated 2019-10-17 08:34 | 0.080s | 4194k | Q:100