Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: Spenceboy98 on December 18, 2012, 09:19:38 pm

Title: [Axe] KarRace
Post by: Spenceboy98 on December 18, 2012, 09:19:38 pm
This is a little game in Axe I started a little while back, but never really finished. Today I finished a little working version:
(http://img.removedfromgame.com/imgs/KarRace.gif)

The object of the game is to dodge the cars that you are passing. Later, I will probably add bonuses and stuff. Download of source is attached.
Title: Re: [Axe] KarRace
Post by: Sorunome on December 18, 2012, 09:20:16 pm
woo, looking good so far!  :thumbsup:
Title: Re: [Axe] KarRace
Post by: DJ Omnimaga on December 18, 2012, 09:55:35 pm
Looks nice. Does it increase in speed as you progress, getting harder?
Title: Re: [Axe] KarRace
Post by: Spenceboy98 on December 18, 2012, 09:56:54 pm
Looks nice. Does it increase in speed as you progress, getting harder?

Not currently, but I can do that. :)
Title: Re: [Axe] KarRace
Post by: Spenceboy98 on December 19, 2012, 01:27:19 pm
*BUMP*
Here is one with a speed up and a menu:
(http://img.removedfromgame.com/imgs/0-KarRace.gif)
(It's actually faster on calc)

Do you think it's too fast? My friend suggested the speed up to be as a bonus. What do you think?

Also, how do you make it display a variable on the screen? I tried earlier, but it did not work.
Title: Re: [Axe] KarRace
Post by: Streetwalrus on December 19, 2012, 01:32:27 pm
What do you mean by showing a variable ? Like display a score on the buffer ? Look at the fix command, it will help you.
Title: Re: [Axe] KarRace
Post by: Spenceboy98 on December 19, 2012, 01:39:24 pm
Like display a score on the buffer ?

Yes. I don't know how the FIX command will help.
Title: Re: [Axe] KarRace
Post by: Hayleia on December 19, 2012, 01:41:48 pm
Also, how do you make it display a variable on the screen? I tried earlier, but it did not work.
If you try to display a number, don't forget the ">Dec". If you do "Text(0,,A)" it will display the string pointed by A, not the number that is in A, which is displayed by "Text(0,,A>Dec)".

Yes. I don't know how the FIX command will help.
The Fix command will help if you need for example the Text routine to write on the buufer instead of writing directly on the screen.
Title: Re: [Axe] KarRace
Post by: Spenceboy98 on December 19, 2012, 01:43:21 pm
Also, how do you make it display a variable on the screen? I tried earlier, but it did not work.
If you try to display a number, don't forget the ">Dec". If you do "Text(0,,A)" it will display the string pointed by A, not the number that is in A, which is displayed by "Text(0,,A>Dec)".

Yes. I don't know how the FIX command will help.
The Fix command will help if you need for example the Text routine to write on the buufer instead of writing directly on the screen.

Thanks
Title: Re: [Axe] KarRace
Post by: DJ Omnimaga on December 19, 2012, 01:47:52 pm
You should make it so when it starts, the first car can't appear in the middle areas, so you don't constantly die instantly at the very start of the game.
Title: Re: [Axe] KarRace
Post by: Hayleia on December 19, 2012, 01:53:04 pm
You should make it so when it starts, the first car can't appear in the middle areas, so you don't constantly die instantly at the very start of the game.
^This. Also, you should not only display other cars when they are entirely on the screen but as soon as they are partly on screen.

(Also, concerning my previous post, notice that >Dec is in Math)
Title: Re: [Axe] KarRace
Post by: Spyro543 on December 19, 2012, 01:55:34 pm
It looks suspiciously like the "Car Racing" game included in most Pop Stations. Good start though, maybe you should actually add a racing aspect to the game.
Title: Re: [Axe] KarRace
Post by: Spenceboy98 on December 19, 2012, 02:08:40 pm
You should make it so when it starts, the first car can't appear in the middle areas, so you don't constantly die instantly at the very start of the game.

Yeah. I do need to do that.

It looks suspiciously like the "Car Racing" game included in most Pop Stations. Good start though, maybe you should actually add a racing aspect to the game.

Well, in the game, you're passing the cars that are going slower than you. At the end, there will be a finish line.

You should make it so when it starts, the first car can't appear in the middle areas, so you don't constantly die instantly at the very start of the game.
^This. Also, you should not only display other cars when they are entirely on the screen but as soon as they are partly on screen.

(Also, concerning my previous post, notice that >Dec is in Math)

I tried, but it was just resetting their positions over and over. It twas annoying, so I just went with what I'm doing now.
Title: Re: [Axe] KarRace
Post by: leafy on December 19, 2012, 02:11:15 pm
May I suggest adding some animated elements to the wheels? This can really add a lot of depth into the motion of the game.
Title: Re: [Axe] KarRace
Post by: Spenceboy98 on December 19, 2012, 02:15:23 pm
May I suggest adding some animated elements to the wheels? This can really add a lot of depth into the motion of the game.

I don't know how to do animated sprites. :P
Title: Re: [Axe] KarRace
Post by: Roboman on December 19, 2012, 03:05:42 pm
I tried, but it was just resetting their positions over and over. It twas annoying, so I just went with what I'm doing now.
Sounds like you don't properly understand that Axe works with unsigned integers.  With this system negative numbers are really very large unsigned numbers.  So if you are using a > instead of a >> then it will trigger if you have a number greater than OR a negative number.  Usefull in some cases but backfires here.
Title: Re: [Axe] KarRace
Post by: Spenceboy98 on December 19, 2012, 03:50:38 pm
Here is a fixed one:
(http://img.removedfromgame.com/imgs/1-KarRace.gif)
Title: Re: [Axe] KarRace
Post by: Sorunome on December 19, 2012, 07:20:43 pm
Looking nice!
Just curious, are you using FULL?
Title: Re: [Axe] KarRace
Post by: Roboman on December 19, 2012, 09:07:42 pm
Those black lines at the edge of the screen... they are there to create the illusion that you are moving, right?  The other cars are moving too, right?  But they are slower than you are moving...  If they are moving... and the black lines are stationary...  you should probably make the black lines move downwards much faster than the other cars.
Title: Re: [Axe] KarRace
Post by: Spenceboy98 on December 19, 2012, 09:13:04 pm
Those black lines at the edge of the screen... they are there to create the illusion that you are moving, right?  The other cars are moving too, right?  But they are slower than you are moving...  If they are moving... and the black lines are stationary...  you should probably make the black lines move downwards much faster than the other cars.

I can try.

Looking nice!
Just curious, are you using FULL?

No. I am not. I'm not even sure what FULL does(TIME FOR RESEARCH).
Edit: Yeah. I'm not(now I know what it does :P).
Title: Re: [Axe] KarRace
Post by: Sorunome on December 19, 2012, 09:14:17 pm
FULL sets the calculator into 16MHZ mode, higher clocking==more speed :D
EDIT: but the 83+ doesn't support that.
Title: Re: [Axe] KarRace
Post by: Ranman on December 19, 2012, 09:22:28 pm
Lookin' great Spenceboy98! 

I agree with Roboman on the lines to create the illusion of speed -- Mak'em move fast! The faster the cars are moving should be directly related to how much faster the lines move with respect to the cars.

Keep up the awesome work!
Title: Re: [Axe] KarRace
Post by: Spenceboy98 on December 19, 2012, 09:33:20 pm
Here it is with FULL:
(http://img.removedfromgame.com/imgs/2-KarRace.gif)

I still haven't fixed the black line things.

Also, can someone explain how to do animated sprites?
Title: Re: [Axe] KarRace
Post by: Sorunome on December 19, 2012, 09:39:44 pm
Well, not so much of a speed increase, i would just stick to without full if i was you ;)
Title: Re: [Axe] KarRace
Post by: Spenceboy98 on December 19, 2012, 10:16:30 pm
Is this a more reasonable speed for the black lines?
(http://img.removedfromgame.com/imgs/3-KarRace.gif)

Also, again, can someone explain how to do animated sprites?
Title: Re: [Axe] KarRace
Post by: Ranman on December 19, 2012, 10:22:12 pm
Is this a more reasonable speed for the black lines?

I'd shoot for about 10 to 20 times faster as a starting point.

I'm not an Axe programmer... so I can't comment on sprite animation. :(
Title: Re: [Axe] KarRace
Post by: dinosteven on December 19, 2012, 10:34:39 pm
I've never used animated sprites, but it should be fairly simple.
[FE134RANDOMSPRITEINFO]->Pic1
[next animation2]
[next animation3]
[animation4]
Through the loop, have a counter go up by 1 - say variable I.
Instead of Pt-On(X,Y,Pic1)
do
Pt-On(X,Y,I^4+Pic1)

Something like that.
Title: Re: [Axe] KarRace
Post by: Spenceboy98 on December 19, 2012, 10:42:24 pm
Is this a more reasonable speed for the black lines?

I'd shoot for about 10 to 20 times faster as a starting point.

I'm not an Axe programmer... so I can't comment on sprite animation. :(

I hope this is good enough.
(http://img.removedfromgame.com/imgs/5-KarRace.gif)

I've never used animated sprites, but it should be fairly simple.
[FE134RANDOMSPRITEINFO]->Pic1
[next animation2]
[next animation3]
[animation4]
Through the loop, have a counter go up by 1 - say variable I.
Instead of Pt-On(X,Y,Pic1)
do
Pt-On(X,Y,I^4+Pic1)

Something like that.

I'll try.
Title: Re: [Axe] KarRace
Post by: epic7 on December 19, 2012, 10:45:46 pm
Looks better now :)

Although they kinda fuse together on the speed up :P
Title: Re: [Axe] KarRace
Post by: Ranman on December 19, 2012, 10:50:59 pm
Now your talkin'.  Looks GREAT! :)

Have you thought about starting at a speed of 0 and increasing up to say... 250mph? As you speed up the lines move faster and faster.
Title: Re: [Axe] KarRace
Post by: Spenceboy98 on December 19, 2012, 10:58:03 pm
Now your talkin'.  Looks GREAT! :)

Have you thought about starting at a speed of 0 and increasing up to say... 250mph? As you speed up the lines move faster and faster.

I can't really make it go at a certain mph. I just do it by pixels. Right now it is going every 5px. The opponent cars are going 1px.
Title: Re: [Axe] KarRace
Post by: Hayleia on December 20, 2012, 12:59:39 am
I've never used animated sprites, but it should be fairly simple.
[FE134RANDOMSPRITEINFO]->Pic1
[next animation2]
[next animation3]
[animation4]
Through the loop, have a counter go up by 1 - say variable I.
Instead of Pt-On(X,Y,Pic1)
do
Pt-On(X,Y,I^4+Pic1)

Something like that.
Yeah, something like that but not really :P
First of all, his sprites are not 8x8 so he surely doesn't use only one Pt-On. Let's say that he uses a routine called Display.
Then, I^4+Pic1 doesn't display the first sprite, then the second one, etc, but it displays the sprite composed of the 8 first bytes found at I^4+Pic1, so when I=0, it works, but when I=1, it displays the 7 last bytes of the first sprite and the first byte of the second one.
So the real formula is Display(X,Y,I^<number of frames in the animation>*<size in bytes of one sprite>+Pic1)
Title: Re: [Axe] KarRace
Post by: stevon8ter on December 20, 2012, 03:52:52 am
I = 0 -> I^4*8 = 0 (anim 1)
I = 1 -> I^4*8 = 8 (anim 2)
I = 2 -> I^4*8 = 128 (nop won't work)

So the real formula =
0->I
Loop
If I= <number of anim>
0->I
End
Pt-on(X,Y,I*8 (or whatever size) +pic1)
I++
Endloop
Title: Re: [Axe] KarRace
Post by: dinosteven on December 20, 2012, 07:43:43 am
I agree with Hayleia. Multiply by the # of bytes a frame takes.
In Axe, the "^" is a modulus, the remainder, not a power.
Title: Re: [Axe] KarRace
Post by: stevon8ter on December 20, 2012, 07:45:54 am
oooh ok, sorry, didn't know that xp

in that case, yes hayleia's formula is correct
Title: Re: [Axe] KarRace
Post by: Roboman on December 20, 2012, 11:12:01 am
Now your talkin'.  Looks GREAT! :)

Have you thought about starting at a speed of 0 and increasing up to say... 250mph? As you speed up the lines move faster and faster.

I can't really make it go at a certain mph. I just do it by pixels. Right now it is going every 5px. The opponent cars are going 1px.

Well, you don't have to do MPH directly to change where the black lines are... you could say... add MPH/5 to the position of the lines?
Title: Re: [Axe] KarRace
Post by: Spenceboy98 on December 29, 2012, 03:17:44 pm
*UPDATE*

Animated Wheels:

(http://img.removedfromgame.com/imgs/6-KarRace.gif)
Title: Re: [Axe] KarRace
Post by: Nick on December 29, 2012, 03:18:52 pm
wow, amazing :) nice work! it looks great
Title: Re: [Axe] KarRace
Post by: Sorunome on December 29, 2012, 03:19:27 pm
woo, the wheels are looking cool :D
Title: Re: [Axe] KarRace
Post by: Spenceboy98 on December 29, 2012, 09:19:31 pm
woo, the wheels are looking cool :D

Thanks!

wow, amazing :) nice work! it looks great

Thanks to you too. :P
Title: Re: [Axe] KarRace
Post by: tr1p1ea on December 29, 2012, 09:21:23 pm
Looks awesome! (There is an artifact at the top of the screen when a sprite is clipped at the bottom of the screen?)
Title: Re: [Axe] KarRace
Post by: Spenceboy98 on December 29, 2012, 09:23:15 pm
Looks awesome! (There is an artifact at the top of the screen when a sprite is clipped at the bottom of the screen?)

I saw that, but I don't know why it does it...
Title: Re: [Axe] KarRace
Post by: Runer112 on December 29, 2012, 09:28:09 pm
It looks like somehow the LCD's z-address got set to 1 (or is it 63?), which makes it so the whole screen is shifted down one row and the bottom one row wraps around to the top. Hopefully it was just caused by some random one-time thing, in which case you should be able to fix it by archiving anything you want to save and then clearing your RAM.
Title: Re: [Axe] KarRace
Post by: Ranman on December 29, 2012, 09:35:48 pm
Lookin' sweet Spenceboy98!!
Title: Re: [Axe] KarRace
Post by: Spenceboy98 on December 29, 2012, 09:50:34 pm
It looks like somehow the LCD's z-address got set to 1 (or is it 63?), which makes it so the whole screen is shifted down one row and the bottom one row wraps around to the top. Hopefully it was just caused by some random one-time thing, in which case you should be able to fix it by archiving anything you want to save and then clearing your RAM.

It works fine on the regular calculator, so....

Lookin' sweet Spenceboy98!!

Thanks!
Title: Re: [Axe] KarRace
Post by: Spenceboy98 on December 30, 2012, 05:40:06 pm
*SUPER DOUBLE POST UPDATE*

It has a finish line now(you don't see it in the screeny). It appears when the score gets over 9000. It now speeds up when you get to 4500 instead of 1500.

(http://img.removedfromgame.com/imgs/9-KarRace.gif)

It seems slower now. Do you think I should use Full?

Also, before I uploaded this pic, this is what RFG looked like:

(http://img.removedfromgame.com/imgs/RFG6.png)
Title: Re: [Axe] KarRace
Post by: DJ Omnimaga on December 30, 2012, 10:17:47 pm
Oh that looks nice with the road lines! :D I also like how you got the wheels animation. :)

(http://img.removedfromgame.com/imgs/RFG6.png)

Rapture from The Game? O.O
Title: Re: [Axe] KarRace
Post by: Spenceboy98 on December 30, 2012, 11:05:50 pm
Oh that looks nice with the road lines! :D I also like how you got the wheels animation. :)

(http://img.removedfromgame.com/imgs/RFG6.png)

Rapture from The Game? O.O

Thank you! Maybe it was rapture. :P
Title: Re: [Axe] KarRace
Post by: Spenceboy98 on March 29, 2013, 12:42:35 pm
*UPDATE*

Not a very large update, but it is one. I had to start from an older version(got deleted from my calc a while back), but I got it back to it's latest state(I had to redo the animation frames and other stuff). Plus, it shows your score back to you when you crash.

(http://img.removedfromgame.com/imgs/10-KarRace.gif)

Also, do you think it seems too slow at first? Should I make it faster? Use Full?
Title: Re: [Axe] KarRace
Post by: Hayleia on March 29, 2013, 01:05:59 pm
Use Full?
No, that would break compatibility with 83+BE for nothing. Also, it seems like you can have it fast without using Full seeing the part after "speed up", so really, there would be no point using Full :)
Title: Re: [Axe] KarRace
Post by: TIfanx1999 on March 29, 2013, 02:00:07 pm
I think the speed is quite fine. Nice looking little program you have there. :)
Title: Re: [Axe] KarRace
Post by: Sorunome on March 29, 2013, 04:02:57 pm
I like the turning wheels :D
Title: Re: [Axe] KarRace
Post by: DJ Omnimaga on March 30, 2013, 03:27:07 am
You should add some cars that goes the wrong way every now and then as the race progresses. :P
Title: Re: [Axe] KarRace
Post by: Spenceboy98 on March 30, 2013, 09:03:14 am
You should add some cars that goes the wrong way every now and then as the race progresses. :P

Yeah. I should make it more difficult as it goes too. :P Maybe I should have a car that looks like it's rotating(like it's swerving). That would probably be too much work to do all those animation frames. If I did do this, do you think that I should keep the regular car that goes by like you're passing it? I probably would need to, so it is not the same thing over and over.

I might slow down the speed up so that maybe I could do multiple speed ups. I'll see what I can do about that.
Title: Re: [Axe] KarRace
Post by: chickendude on March 30, 2013, 01:22:31 pm
...I might slow down the speed up...
:P

I think an interesting idea might be to turn it into more of a racing game, Lotus Turbo Challenge-style. Holding 2nd will accelerate the car (releasing it will slow the car down) and you have to make it to a checkpoint within a certain amount of time, that sorta thing. Adding multiple cars would be cool, too. It looks really pretty, the car sprites are exceptionally well done (did you draw them yourself? Seriously, they're gorgeous!) it just feels like a slow avalanche game right now. You could even have power-ups that would let you shoot a car that's in front of you or temporarily upgrade your bumper to absorb shocks from bumping into other cars, that sorta stuff. You could maybe even have the other cars turn slightly while they come down. Anyway, the animation and everything looks great, you've done a great job so far!

EDIT: Oh, and i second not breaking 83+ compatibility!
Title: Re: [Axe] KarRace
Post by: zeldaking on March 30, 2013, 06:06:03 pm
I had an idea similar to this, but I'll let you tackle this one as it seems you have nailed this on. My idea was loosely based off of the handheld sega mcdonald toy, "Sonic Speedway". http://sonic.wikia.com/wiki/Sonic_Speedway  Which is similar to you game in a sense. This game was based off the game "Sonic Drift" which I was also thinking of porting. Maybe consider this while planning your game?  http://sonic.wikia.com/wiki/Sonic_Drift  Overall it's looking good!
Title: Re: [Axe] KarRace
Post by: Spenceboy98 on March 30, 2013, 06:39:28 pm
...I might slow down the speed up...
:P

I think an interesting idea might be to turn it into more of a racing game, Lotus Turbo Challenge-style. Holding 2nd will accelerate the car (releasing it will slow the car down) and you have to make it to a checkpoint within a certain amount of time, that sorta thing. Adding multiple cars would be cool, too. It looks really pretty, the car sprites are exceptionally well done (did you draw them yourself? Seriously, they're gorgeous!) it just feels like a slow avalanche game right now. You could even have power-ups that would let you shoot a car that's in front of you or temporarily upgrade your bumper to absorb shocks from bumping into other cars, that sorta stuff. You could maybe even have the other cars turn slightly while they come down. Anyway, the animation and everything looks great, you've done a great job so far!

EDIT: Oh, and i second not breaking 83+ compatibility!

Hm... good ideas. I might actually make this into a racing game(it's called KarRace, so...).  It probably won't take me much to take out the speed up and add acceleration. I would make more sprites, but I don't want to make the size of the game too big :P(and yes, I created the sprites myself, thanks :)). I was thinking about doing powerups at the beginning, but I have it so that if there is an "on" pixel in front of the car, it is a crash, so I am not sure how I would implement it.

Does anyone else think I should do acceleration instead of speed up after a certain amount of time?

I had an idea similar to this, but I'll let you tackle this one as it seems you have nailed this on. My idea was loosely based off of the handheld sega mcdonald toy, "Sonic Speedway". http://sonic.wikia.com/wiki/Sonic_Speedway  Which is similar to you game in a sense. This game was based off the game "Sonic Drift" which I was also thinking of porting. Maybe consider this while planning your game?  http://sonic.wikia.com/wiki/Sonic_Drift  Overall it's looking good!

I might check this out another time. Thanks!
Title: Re: [Axe] KarRace
Post by: DJ Omnimaga on March 31, 2013, 12:09:19 am
Actually allowing accelerating/braking like in Lotus would also make it less like just another Tunnel type game (although it's not a tunnel but it isn't really a proper racing game yet). You could have checkpoints too.
Title: Re: [Axe] KarRace
Post by: Spenceboy98 on March 31, 2013, 04:10:30 pm
*UPDATE*

Now the game starts with the speed equaling 0. You press [2ND] for power(thinking about doing [ALPHA] for brakes and [^](UP) for temporary boost). Now the other player(s) keeps going if you stop(note: there is no real track, so opponent just loops around screen).

(http://img.removedfromgame.com/imgs/11-KarRace.gif)

Things to do(in no particular order):
1. Fix wheels so the stop when vehicles stop :P .
2. Figure out how to do a track with multiple checkpoints.
3. Checkpoints(in #2, but saying it anyways).
4. Timer to time player(won't be too hard unless you guys want actual seconds which I don't know how to do).
5. Finish title screen(put the title in the title screen, polish it, etc).

Any other things I missed? Any suggestions?

Edit:
I also made it so that when you put power it goes up slowly, but you can't really tell because it's so fast. Any ideas on how to make it any slower and noticeable?
Title: Re: [Axe] KarRace
Post by: Matrefeytontias on April 01, 2013, 10:18:59 am
How are you handling the speed ? Is it a variable you continuously add to your position ?

If so, divide this variable's value by 2 when adding it. It'll make the acceleration smoother. Also, don't forget to multiply the speed limit by 2 too.
Title: Re: [Axe] KarRace
Post by: chickendude on April 01, 2013, 11:43:36 am
You might need to use larger variables/values. I'm not sure how you advance the screen, but you could do something like an acceleration of 8 advances 1 pixel a frame, an acceleration of 1 will advance 1 pixel every 8 frames, and an acceleration of 64 (!) would advance 8 pixels a frame. You could also use a higher value, though a power of 2 would be most convenient. That way you can just shift it over and get how many pixels you need to advance. Maybe every ten frames you could raise the acceleration by 1, assuming you're holding [2nd] that way it'll gradually get faster. So you could have two variables, acceleration and a scrolling variable. The acceleration gets added to the scrolling variable, and if it's greater than (say) 8, scroll the screen. If it's a multiple of two, you can just bit shift it over and you'll have how many pixels to scroll.