EDIT: It's now in the archives Smile https://www.cemetech.net/programs/index.php?mode=file&path=/84pce/asm/games/SwitchOperator.zip

Hey everyone! I've decided to enter this contest with an idea of my own Smile

I just came up with a better idea for a game, without complex storylines and complicated mechanics. Without further ado, let me present Switch Operator!
---------------------------
Switch Operator
---------------------------
You take the place of a switch operator at a railroad tunnel. There are four lines, and each one has a gate for the trains to go through. Your job is to control the gates, as there are no sensors installed on the inside of this tunnel, so the gates only open automatically for incoming trains. You have to make sure that the trains don't run into a gate or some other obstacle. Only one gate can be open at a time, so you are constantly opening and closing them. Sometimes a gate will get stuck and you will have to make the train switch to an above or below track, and open the gate there. As the game progresses, the railroad upgrades their gate system so that multiple can be open at once, but they close automatically.
---------------------------
You will need to be fast with your fingers, as the gates are controlled by the numbers [0], [1], [4], [7] (the western gates) and [(-)], [3], [5], [9] (the eastern gates). The switches are controlled by simultaneously pressing [.], [2], [5], or [8] for the corresponding track, and pressing the arrow key in the direction you want to switch it towards, North or South (or up and down)

So I'm not sure how this question thing will work, but I can ask any manner of questions having to do with the C libraries and I will not be penalized?
So I've made progress! I have most of my sprites created and sorta working, so far.
EDIT: Turns out I misunderstood palettes a little Razz

Anyways, heres a screenshot of the title screen. I need to fix up my erasing, but other than that, things are working out pretty good.

Wow, very nice sprites and smooth moving, of course, you are going to want to get the cross sections of the track to be redrawn and maybe remove the white outline around the train sprites, but it's looking good!
Thanks! I already have removed the white outlines, and the redrawing but is a little harder to fix, because the sprite is 7 pixels wide, and the train moves 1 at a time. I could make the train move 7, but I would have to slow it down, and slowing it down may make it look less smooth.
Why not just double buffer it and redraw everything in a loop like a normal game would do Wink Anywho, keep up the great work Smile
MateoConLechuga wrote:
Why not just double buffer it and redraw everything in a loop like a normal game would do Wink Anywho, keep up the great work Smile
So I'm not sure why I should double buffer. To redraw the tracks?
In any case, I don't quite get what you mean Neutral

EDIT: Heres the newest screenshot, I have multiple trains on random tracks, and I have gates coming soon!
So I believe it is in the contest rules to ask for suggestions about something?
I was wondering what you guys think I should use as a gate. I was trying to use like a railroad crossing one, but I am terrible at pixel art and that didn't quite work out. If someone could make one for me, or suggesting another way to do a gate, I'm all ears. Smile
I'd be very happy to pixel art a top-down level crossing, if it's within the rules according to jonbush. I'm thinking that you'd primarily want to represent a level crossing as a road going across the tracks, with the suggestion of silver where the lights are at the edge of the road, and a white/red line across the road representing the arm.
So I decided not to go with the gate idea and I instead use red and green lights. Here's a screenshot with the red ones. As you can see, I don't exactly have game-ending working, today was mostly just making those sprites and implementing them. Not much progress, but maybe tomorrow will be better. Smile

In the meantime, can you explain the way the train sprites work? Is it a series of 8-pixel-wide sprites that you display in a row, or fewer sprites that you use with the clipping sprite routines?
It is one train sprite, but I start drawing it at about X -190 so it looks as if it appears from the side of the screen. I do not use the clipping routine.

Anyways, I've made progress!

I've added highscores and actual loosing, as you can see in the screenshot. The pace of the game also increases as you progress.

Unicorn, how did you get your train sprite to move smoothly across the screen without it leaving copies of itself and blinking? I would really like to know because I have that problem in my program.
seanlego23 wrote:
Unicorn, how did you get your train sprite to move smoothly across the screen without it leaving copies of itself and blinking? I would really like to know because I have that problem in my program.

To make it move smoothly, he redraws the sprite every single pixel across the screen. to make it not leave a nasty trail, he redraws the track behind it.
Mr womp womp is correct. In more detail, though, I took one big track sprite and cut a segement off that was 7 pixels wide. I then move the train 7 pixels, then redraw the track sprite 7 pixels behind that.
You could also try many tiny pixel buffers.

Also, it looks like you have a timing issue (found in your animation):

Palette seems inconsistent as well, but I'll blame the GIF maker for that.
I think the timing issue could also be caused by the GIF maker (taking a frame in the middle of drawing stuff?? I know that some GIFs I've captured in the past have had frames with half drawn shapes on the screen) besides, if there is such an issue, the train flies by too fast for it to be noticeable and therefore worth fixing (except maybe for personal reasons, wanting it to be perfect and stuff...)
A better option would be to double buffer and simply redraw the whole screen each time, and then swap buffers. This would be a lot easier than what you are trying to do currently Smile
MateoConLechuga wrote:
A better option would be to double buffer and simply redraw the whole screen each time, and then swap buffers. This would be a lot easier than what you are trying to do currently Smile

I'm not entirely sure how effective that is, it seems to be slow, so I'm sticking with my original method for now.

Besides that, though, I was wondering if anyone could make a short 2-4 page animation of this train switch to tracks above and below it?



The red line would be the path of the train.

So its been a while since an update, abut here I am!

I'm got multiple trains moving at the same time! They start at a score of ten, but for screenshot purposes they started at a score of 1.

(the program isn't that fast on calc, I slowed it down. Wink)



So next I'm going to implement something of a story mode, with some images. Is there any way to have those without making huge sprites? Is there something like the xLIBC background command? There will also be a currency so you can "buy" added perks and help.
Also, if you let a train crash you have to pay for lost cargo, but you can bribe workers to say that it wasn't you to blame, causing pay for damages. (or you may be able to keep going, not sure yet)

What do you think!
Bumpdate!

I've made it into three gamemodes, Campaign, Endless, and Bullet.
Campaign acts as a campaign, sort of like an rpg but not as complex. (I only have the base gameplay done)
Endless is endless, goes on forever until you lose, and it saves a highscore.
Bullet is endless but super fast and it doesn't have multiple trains at once. (Because that would be two hard) I'm going to add a separate highscore for this one.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement