HP Forums
GAME: Racer - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: HP Prime Software Library (/forum-15.html)
+--- Thread: GAME: Racer (/thread-5628.html)



GAME: Racer - Mark Power - 02-01-2016 10:17 PM

Hi Everyone, I've been following a tutorial on building an Outrun style racing game. My kids and buddies think it is now ready to unleash. Have fun and let me know what features you'd like me to try to squeeze in next.

[Image: splash.png][Image: night.png][Image: setup.png]



How to install this app:
  • Make sure to update to the latest firmware (8151 or higher).
  • Make sure to update to the latest Connectivity Kit (8151 or higher).
  • Download New v35
  • Unzip Racer35.hpappdir.zip.
  • Copy the Racer35.hpappdir folder into your HP Connectivity Kit\Content folder on your PC or Mac.
  • Run the Connectivity Kit and connect your calculator to your PC or Mac (or optionally run the virtual emulator).
  • Drag the Racer35.hpappdir folder on the left pane of the connectivity kit window, just inside "App Library" category and drop it there.

How to play
  • Select Racer from the Apps screen
  • Press [ENTER] to start a race with the default setup, any other key for instructions. Get back here by pressing [View]
  • Optionally go to Setup... and alter the number of laps to race and whether you want AutoAccelerate (on by default), easy or hard track, day or night mode, and traffic to get in your way
  • Select Start Race
  • Steer using [1] and [2], the cursor pad or arrow keys on the emulator
  • Use [+] and [-] for accelerate and decelerate
  • Keep off the grass!

Limitations
  • Two tracks but you can build your own in ResetRoad() if you are feeling brave.
  • I've added AutoAccelerate so that you don't have to hold down the [+] key to get the car moving.
  • Only 20 road segments drawn per frame to keep the frame rate up. Some serious optimisation is needed to improve this.
  • v23 should fix failure to start
  • v32 fixes timing on the virtual HP Prime and allows steering using PC or Mac arrow keys (in addition to 1 or 2)
  • v35 adds compatibility with firmware 13333 which has an issue with DIMGROB. This version should be compatible with earlier versions of firmware if you have not yet updated to 13333.

Thanks
  • Sega
  • Jake Gordon for his excellent javascript racer tutorial http://codeincomplete.com/posts/2012/6/22/javascript_racer/
  • Tim Wessman and all at HP for truly amazing hardware and spectacular firmware
  • mandresve for showing us how to view png files
  • Han for his tutorial on TRIANGLE which I still haven't used but which inspired me to try 3d out the hard way



RE: GAME: Racer - Forrestglade - 02-01-2016 11:15 PM

I can't get it to work on my Prime (hardware version A and updated to latest firmware on calc+connectivity kit).

The app will start in the calculator and show me the help screen. When I press "view" then "2" it counts down from 3 to 1 and then freezes on 1. ? ? ?
It does the same thing for both the emulator and the real calculator.

I don't really care if the game works or not but I thought it was cool that you put in the effort and I thought I'd give some feedback.

Edit: After a day or so I tried to play the game again and it worked correctly. I only lightly use my Prime so there shouldn't be very much in the memory. I also have hardware version "A." This reminds me of the racing game on my grandpa's Vectrex machine; good memories.


RE: GAME: Racer - Mark Power - 02-02-2016 03:52 AM

Download the latest version, it should work fine now.


RE: GAME: Racer - Mic - 02-03-2016 12:36 PM

Great work !


RE: GAME: Racer - cyrille de brébisson - 02-05-2016 05:51 AM

THIS IS SOOOO COOOOL!!!!!!

Great work!

Cyrille


RE: GAME: Racer - Mark Power - 02-16-2016 09:52 AM

I've posted v23 which should fix problems starting the game. Download from the link at the top of this thread. Some people experienced a problem with the zip file yesterday, so I've re-zipped it and it all seems to be working correctly.


RE: GAME: Racer - Eddie W. Shore - 02-21-2016 04:22 PM

Wow - amazing.


RE: GAME: Racer - Kevin Ouellet - 02-25-2016 06:12 AM

Wow this looks great! I had in mind to make a similar program in the past, using BLIT_P instead (like the guy who made Trailblazer Prime two years ago), but I was too busy with other projects to learn how to do it and I was planning to use a smaller resolution then zoom in with BLIT_P afterwards.

Keep up the good work. Smile


RE: GAME: Racer - Mark Power - 03-01-2016 10:18 PM

V28 is now available. This adds:
  • Easy or hard tracks
  • Day and night modes
  • Traffic to get in your way
  • Lane markings



RE: GAME: Racer - critor - 03-16-2016 06:29 PM

Very nice. Big Grin

Now let's just add sound and we can replace our Sega Outrun arcade cabinets with HP-Prime calculators : Wink





RE: GAME: Racer - KlaasKuperus - 03-29-2016 10:17 AM

This is really great! Smile


RE: GAME: Racer - Mark Power - 04-11-2016 07:41 PM

v30 is now available. Minor update adds:
  • Splash screen to allow quick start using default settings (thanks to DJ Omnimaga for the suggestion)
  • Fixed display of lap counter and lap time (thanks to critor's video showing this unexpected behaviour)



RE: GAME: Racer - Kevin Ouellet - 04-12-2016 05:22 AM

THanks for the update. I will download it soon. Smile


RE: GAME: Racer - Mark Power - 02-14-2017 10:06 PM

v32 is now available. Minor update adds:
  • Timing is now implemented more effectively so that the game runs at roughly the same speed on the virtual HP Prime as on the real calculator.
  • When using a virtual Prime you can steer using the cursor pad on the emulated calculator, or using the keyboard left and right cursor keys.
  • Using the real calculator steering can be via left and right on the cursor pad, or the original 1 and 2 keys.



RE: GAME: Racer - wangchong01 - 06-08-2017 01:34 PM

I have simnplified the code a bit so that the game could play on the real HP Prime more quicker.I think that frequent assignment to variants should be avoided to impove the speed, hope you can make the game quicker.


RE: GAME: Racer - Mark Power - 06-08-2017 07:16 PM

Thank you for the suggestions on improving Racer. I certainly would like to speed it up as that would allow:
  • an increase in draw depth, allowing you to see the road going further towards the horizon
  • addition of road signs
  • addition of palm trees
  • distance haze or fog (using alpha blending that has been added in recent firmware)

Whilst you've made the code much shorter, it has lost some readability which may make further changes difficult. It also doesn't seem to work at all well on the Mac virtual Prime - which is a shame as v32 added support for the virtual Prime.

On my physical Prime your version seems to have a few problems - like the road width is incorrect and hence the other cars are sometimes off the road. However it also seems to run slower.

Have you posted the correct version or was this just a concept to allow further optimisation?

Regards,
Mark


RE: GAME: Racer - wangchong01 - 06-09-2017 04:50 AM

Sorry for uploading the wrong version.However,I have deleted the correct version.The version attached is added with more functions such as maxpower and speed reduing while climbing up,but I didn't change the rendering function.I think you can use the TRIANGLE_P fucntion to make the game more quicker.The sample of the function is also attached.


RE: GAME: Racer - Mark Power - 02-12-2018 10:03 PM

v35 is now available. This is a minor update:
  • Adds compatibility with firmware 13333, which has an issue with DIMGROB.
  • This version should also work with older versions of firmware.