Post Reply 
GAME: Racer
02-01-2016, 10:17 PM (This post was last modified: 02-12-2018 10:06 PM by Mark Power.)
Post: #1
GAME: Racer
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/2...ipt_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
Find all posts by this user
Quote this message in a reply
02-01-2016, 11:15 PM (This post was last modified: 02-17-2016 04:11 AM by Forrestglade.)
Post: #2
RE: GAME: Racer
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.
Find all posts by this user
Quote this message in a reply
02-02-2016, 03:52 AM (This post was last modified: 03-01-2016 10:30 PM by Mark Power.)
Post: #3
RE: GAME: Racer
Download the latest version, it should work fine now.
Find all posts by this user
Quote this message in a reply
02-03-2016, 12:36 PM
Post: #4
RE: GAME: Racer
Great work !

http://mic.nic.free.fr - Youtube - Facebook
Find all posts by this user
Quote this message in a reply
02-05-2016, 05:51 AM
Post: #5
RE: GAME: Racer
THIS IS SOOOO COOOOL!!!!!!

Great work!

Cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
Find all posts by this user
Quote this message in a reply
02-16-2016, 09:52 AM
Post: #6
RE: GAME: Racer
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.
Find all posts by this user
Quote this message in a reply
02-21-2016, 04:22 PM
Post: #7
RE: GAME: Racer
Wow - amazing.
Visit this user's website Find all posts by this user
Quote this message in a reply
02-25-2016, 06:12 AM
Post: #8
RE: GAME: Racer
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

-Dream of Omnimaga
https://dreamofomnimaga.page
Visit this user's website Find all posts by this user
Quote this message in a reply
03-01-2016, 10:18 PM
Post: #9
RE: GAME: Racer
V28 is now available. This adds:
  • Easy or hard tracks
  • Day and night modes
  • Traffic to get in your way
  • Lane markings
Find all posts by this user
Quote this message in a reply
03-16-2016, 06:29 PM (This post was last modified: 03-16-2016 06:30 PM by critor.)
Post: #10
RE: GAME: Racer
Very nice. Big Grin

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


Find all posts by this user
Quote this message in a reply
03-29-2016, 10:17 AM
Post: #11
RE: GAME: Racer
This is really great! Smile

Product Manager HP for MORAVIA Consulting, the EMEA & AP Licensee for HP Calculators.

http://www.hpcalcs.com
Find all posts by this user
Quote this message in a reply
04-11-2016, 07:41 PM
Post: #12
RE: GAME: Racer
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)
Find all posts by this user
Quote this message in a reply
04-12-2016, 05:22 AM
Post: #13
RE: GAME: Racer
THanks for the update. I will download it soon. Smile

-Dream of Omnimaga
https://dreamofomnimaga.page
Visit this user's website Find all posts by this user
Quote this message in a reply
02-14-2017, 10:06 PM
Post: #14
RE: GAME: Racer
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.
Find all posts by this user
Quote this message in a reply
06-08-2017, 01:34 PM
Post: #15
RE: GAME: Racer
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.


Attached File(s)
.zip  Racer.hpappdir.zip (Size: 39.41 KB / Downloads: 7)
Find all posts by this user
Quote this message in a reply
06-08-2017, 07:16 PM
Post: #16
RE: GAME: Racer
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
Find all posts by this user
Quote this message in a reply
06-09-2017, 04:50 AM
Post: #17
RE: GAME: Racer
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.


Attached File(s)
.hpprgm  maze3d2.hpprgm (Size: 20.8 KB / Downloads: 6)
.hpprgm  racer_wky_2.hpprgm (Size: 36.75 KB / Downloads: 8)
Find all posts by this user
Quote this message in a reply
02-12-2018, 10:03 PM
Post: #18
RE: GAME: Racer
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.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 2 Guest(s)