Skyway


Alex.

Retired
Joined
Aug 24, 2005
Messages
4,616
Last update: Sunday October 9, 2005

sw02.gif
DOWNLOAD HERE: skywayGP32r2.zip

Controls:
- Press START at the beginning to skip text intro
- Joystick moves orange ship
- A shoots
- L+R forfeits game. After that press A to softreset.


I included the sourcecode .prg file in the zip, as I want all the feedback I can get. The game is in early stages, but here are the features already implemented:
- 2 types of enemy ships
- smart enemies, they follow you horizontally
- 3 types of bonus items - [ spam word ], speed increase, score increase
- original graphics
- 2 scrolling backgrounds (parallax)
- hiscore save in skyway.sco file


You cannot have more than 3 player bullets, 6 enemy bullets, and 5 enemy ships on the screen at a time.

Please help me with the following (pretty please :D)

1. I'm trying to kill a specific bullet process (player's bullet) when an enemy ship has been shot - right now the same bullet goes through n-ships until it reaches the end of the screen - any suggestions there? I made it with a timer that kills the bullet after 1 second to enemy collision, but that gives unexpected results at best :(

2. Is there any way to pause all processes at the same time (and then resume them)? I'm trying to implement a pause feature to the game...

3. I set the game to run at 30 FPS with 0 FS, but on the GP it runs at 25-27 FPS. Are there any optimizations I could do to the source to make it faster?

What I plan to eventually add:
- Explosion effects when enemies are shot down
- Maybe scripted levels
- more bonus items
- hiscore saved in table, allowing for top ten
- add energy shield feature, via B key
- add pausing feature
- improve interface, and how score/life etc. are displayed+layed out.
- companion ships


Thanks, and have fun playing Skyway! :)
 
Alex. posted on Oct 4 2005 at 08:03 PM said:
sw01.gif

DOWNLOAD HERE: skywayGP32.zip

Controls:

- The FXE appears as a blank icon "Without Splash" (I didn't get around to editing it yet...
- Press START at the beginning to skip text intro
- Joystick moves orange ship
- A shoots
- L+R soft resets you GP; losing all life will also exit via soft reset.


I included the sourcecode .prg file in the zip, as I want all the feedback I can get. The game is in very early stages, but here are the features already implemented:

- 3 types of enemy ships
- 3 types of bonus items - [ spam word ], speed increase, score increase
- original graphics, although I just took Racemaniac's standard 8bit palette, I should tailor one to suit my specific needs
- hiscore save in cool skyway.sco file (only one score is saved for now, no table)

I made it so you won't have more than 8 player bullets, 8 enemy bullets, and 5 enemy ships on the screen at a time, because I noticed that when there are lots of processes at a time, parts of sprites are left behind on the screen (maybe that's a bug in my code, please tell me!)

One thing I'm trying to fix is killing a specific bullet process (player's bullet) when an enemy ship has been shot - right now the same bullet goes through n-ships until it reaches the end of the screen - any suggetsions there?

Also keep in mind that I never touched Fenix before (and I love it), and therefore need any advice/feedback - one can never learn enough :)

Thank, and have fun playing it! :)

EDIT:

What I plan to eventually add:

- Explosion effects when enemies are shot down
- Maybe scripted levels
- scrolling background (maybe parallax with some nice clouds and islands underneath)
- more bonus
- hiscore saved in table, allowing for top ten
- add energy shiel feature, via B key
- improve interface, and how score/life etc. are displayed+layed out.

Looks cool, I'll try it out.
 
Last edited by a moderator:
Hey it's good!
Suggestion:
-Make the player's ship a little smaller, maybe 66-75% what it is. At the mo' it's really difficult to dodge bullets (though the health running down from 100 sort of makes up for it, so not that important)
-Have a wee pause occassionally. Maybe when you put in levels you'll get this anyway.

But apart from that, well done! I just had a go and enjoyed it, though my GP (blu+) reset when I hit around 18 life points. No idea if I was doing anything particularly stand-out at the time (it's quite a full-on game isn't it, barely time to breathe!)
I like that you can pick up health boosts, nice touch. And the graphics are good and clean with no clutter.

I really like what you've done here, great first effort. Looking forward to an update so keep us posted won't you!
 
very well done :)
i checked the source, pretty good, one little remark: you defined at the beginning of the enemyship process some variables as local
it should have been private, local variables are defined at the beginning of the program, just like globals, and are public variables that all processes will have, and that are also visible to other processes (i don't think you can give processes their own unique local variables...), in the process itself you can make seperate private variables (which it seems to have done, although you wrote local ^^, so doesn't really make a difference i assume) ^^

and a suggestion: i added to the enemy ships the private variable xspeed, which i increased and decreased where you now increase and decrease the x value, and every loop i add that speed to their x value, it makes the ships move to the side a bit :), perhaps a good idea to implement ^^
 
Thanks for the replies :)

K0K0NUT_h3lmut
Thanks, and don't forget to report bugs!

alyinsanfran
You're right, I'll make the ship smaller, maybe 20 by 20 as opposed to 30 by 30 as it is right now.
I'll use the Select button for pausing, I can't believe I forgot to make it pause :D
I'm not sure what could have happened to reset your GP at 18hp, but when you collide with an enemy ship, you lose 10 life points, and when with a bullet 1 - maybe there were 2 enemy ships one over the other ;)

Racemaniac
I'll change the variable definition, thanks (I was used to Locals from TIBasic).
As for sideways movement, I already have x += enemyshipspeed; and x -= enemyshipspeed;, although they only happen 10% of the time each. Should I make them move all the time?

Again, thanks for the feedback!
 
Alex. posted on Oct 5 2005 at 09:39 PM said:
Thanks for the replies :)

K0K0NUT_h3lmut
Thanks, and don't forget to report bugs!

alyinsanfran
You're right, I'll make the ship smaller, maybe 20 by 20 as opposed to 30 by 30 as it is right now.
I'll use the Select button for pausing, I can't believe I forgot to make it pause :D
I'm not sure what could have happened to reset your GP at 18hp, but when you collide with an enemy ship, you lose 10 life points, and when with a bullet 1 - maybe there were 2 enemy ships one over the other ;)

Racemaniac
I'll change the variable definition, thanks (I was used to Locals from TIBasic).
As for sideways movement, I already have x += enemyshipspeed; and x -= enemyshipspeed;, although they only happen 10% of the time each. Should I make them move all the time?

Again, thanks for the feedback!
i'll show you what i did. the "problem" was that your ships seemed to jump a tiny bit to the left/right. when i checked your code you indeed in 10% of the cases altered their position. as yo ucan see this makes your ships jump a bit to the side, but it's no more than a bit of noise, and looks unnatural.
i simply added a variable for the speed in the x axis, which wil lget added to their position every frame, and gets altered where you now change their position, making them move fluently :)
i'll show the code of the enemy ship (the difference is that you altered their position, i altered their speed in those 10% of the time)

Code:
process enemyship(x,y)
private 
random;
picture;
xspeed;

begin
      
	graph = enemies[rand(0,2)];
	z = 2;
	
	while(y < 240)
  y += enemyshipspeed;
  x += xspeed;
  random = rand(1,50);
  
  if(random < 6 and enemybullets < maxenemybullets)
  	enemybullet(x,y);
  elseif(random > 5 and random < 11 and x < 310)
  	xspeed ++;
  elseif(random > 10 and random < 16 and x > 10)
  	xspeed--;	
  end
  
  if (collision(type bullet))
  	if (random == 16) medicinebonus(x,y);
  	elseif (random == 17) scorebonus(x,y);
  	elseif (random == 18) speedbonus(x,y); end
  	ships--;
  	score++;
  	return;
  elseif (collision(type ship))
      life -= explosiondamage;
  	ships--;
  	return;
  end
  
   frame;
	end
	
	ships--;
	return;

end
one problem is ofcourse sometimes a ship moves out of the screen, but that can easily be fixed :)
 
Last edited by a moderator:
I updated the first post with the progress and a second release download! Be sure to check it out!

Here are screenshots before and after:
sw01.gif
sw02.gif


Racemaniac
Thank you for that ship movement code, it works like a charm! :)

Edit: oops, it seems like the starting score for all games is 600, I'll fix it in the next release :D
 
Oh, I didn`t notice you have updated your game :D YOu should post this in the news or something :D

Alex. posted on Oct 5 2005 at 02:03 AM said:
Please help me with the following (pretty please :D)

1. I'm trying to kill a specific bullet process (player's bullet) when an enemy ship has been shot - right now the same bullet goes through n-ships until it reaches the end of the screen - any suggestions there? I made it with a timer that kills the bullet after 1 second to enemy collision, but that gives unexpected results at best :(

2. Is there any way to pause all processes at the same time (and then resume them)? I'm trying to implement a pause feature to the game...

3. I set the game to run at 30 FPS with 0 FS, but on the GP it runs at 25-27 FPS. Are there any optimizations I could do to the source to make it faster?

1. Since only checking for collision does not always work, you have to kill the bullet some frames after it hit the ship.
Here is the code for the bullets I use in Mini Slug, maybe you can use it:
Code:
process minislug_bullet(x,y,z,bullet_angle)
 private
   death=0; 
   deathcount=2; //deathcount, if it gets 0 the bullet is gone, it`s the number of frames after the bullet gets killed

 begin
   file=minislug_fpg; graph=2; size=150; // ignore this
   angle=get_angle(minislug_cursor_id);  // and this
   loop
     // ignore this, too
     advance(17);
     if(x<-20 or y<-20 or x>340 or y>260)
       minislug_timeeffect(160,65,1);
       minislug_time-=5;
       return;
      end;
      // your ignoring should end here

     //here, when the bullet hits something, the death flag is set to 1
     if(collision(type minislug_target)death=1;end;

     //if deathflag is 1, count down deathcount and 
     //if deathcount lower or equal zero, the bullet gets killed
     if(death==1)
       deathcount--; //count down
       if(deathcount<=0) //if state
         return; //return; kills the bullet
        end;
      end; 
     frame;
    end;
  end;


2. I have found a pretty easy and plain solution for that, I`m using in the minigame project (next version :D).
Have something like this as a "global" process, I mean, when a game is start, it has to run in background, replace process1, process2, etc, with the names of your processes.
Code:
process pauser();
 private
   st_pressed=0; done=0; freezed=0;   
 begin
   loop
     if(key(_enter))st_pressed=1;end;
     if(not key(_enter) and st_pressed==1)
       //this process remembers if the game is paused or not:
       //if freezed==0 every process is running and gets freezed here
       if(freezed==0 and done==0)
         signal((type process1),s_freeze); //process 1 = a process from your game
         signal((type process2),s_freeze); //another process from your game
         ... //add every othe process that is used when the game is running here 
         freezed=1; done=1;
        end;

       //if freezed==1 every process is freezed and gets woken up here
       if(freezed==1 and done==0)
         signal((type process1),s_wakeup); //same as above
         signal((type process2),s_wakeup);
         ...
         freezed=0; done=1;
        end;
       done=0; st_pressed=0;
      end;
     frame;
    end;
  end;

3.Framerate completely depends on your code, you have to try to optimize things by yourself, but there are y few things that slow the gp32 really down: using maps, using scrolling, using much text, using many processes at the same time, and much more I think.
 
Last edited by a moderator:
Thanks for replying Quiest, and thank you for the help!

Here is what I worked yesterday for the bullet (goes inside the enemyship process):

Code:
bulletid = collision(type bullet);
  
if (bulletid)
	ships--;
	signal(bulletid,s_kill);
	bullets--;
	return;
end

Your pause method is awesome! I was playing around with s_freeze and s_wakeup, but you made it crystal clear! I am implementing it as I post.

About the framerate, now it seems to run at 30FPS again, strange, could it have something to do with how many files there are on the SMC, the capacity of the SMC, or the batteries?
 
Normally not, since the whole game gets load into the gp32 memory...

And if your bullet killing works, then stick to it. :)
 
Back
Top