Mario Kart thing (Tero Kart)

Show off your games, demos and other (playable) creations.
User avatar
Party member
Posts: 212
Joined: Wed Apr 18, 2012 12:37 am

Mario Kart thing (Tero Kart)

Post by retrotails » Fri Jul 13, 2012 7:40 am

So, I decided to continue this project. First thing... start from scratch. Also, it has been renamed Tero Kart. How original. Right now it has Crash, because I already made a kart model for him as a request by some guy to insert into Trackmania. is basically the scanline renderer stripped down. You can use it for whatever, I prefer credit but I don't think it's original enough.


Mario Kart clone, with unoriginal images for now. Some basic gameplay implemented.
You will most likely glitch into the wall if you hit it, I don't really know what to do about it.
  • Initial release
  • W and S scaling works properly, FoV corrected, Mario sprite added with racing controls (kinda)
  • Basic gameplay elements implemented!
  • Jumping (left ctrl)
  • Really bad collision detection
  • Slowdown & speedup patches
  • Optional motion blur (Warning, uses canvases!)
    Change motionblur (conf.lua:2) to 'true' to enable it,
    and I recommend enabling v-sync as well if you do,
    because lower framerates = more blur, and 75 FPS on my monitor
    seems to be a good amount.
    I will fix that later.
  • Sounds
  • Any resolution should work
  • Filesystem bug fixed
Last edited by retrotails on Tue Sep 18, 2012 2:33 am, edited 7 times in total.

User avatar
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands

Re: Mario Kart thing

Post by bartbes » Fri Jul 13, 2012 8:13 am

That looks awesome!

User avatar
Inner party member
Posts: 3653
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA

Re: Mario Kart thing

Post by Jasoco » Fri Jul 13, 2012 8:34 am

Not to steal your thunder...


Though mine uses canvases. I'll have to look at how you do yours since I'd like to get a canvas-free method of doing "Mode 7" for my Wolfenstein engine too.

Mine requires canvas:

Canvas A is a container.
Canvas B is the map.

Canvas B is drawn onto Canvas A at the rotation and offset of the camera at the bottom center of A.
A whole array of Quads are applied to Canvas A from the bottom to the top with the entire width of the Canvas A.
A raycasting function figures out which Quads each line of the floor are visible and draws them. Their scale is based on their distance using the same math that is used for wall segments and sprites within the map. My Mario Kart engine was derived from my Wolfenstein engine.

I also get pretty high framerate. (The only reason it's at 57 right now is because I had VSync on for some reason) My method cannot be done without canvases.

User avatar
Inner party member
Posts: 1944
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Mario Kart thing

Post by Nixola » Fri Jul 13, 2012 8:47 am

I get 70+FPS on my Netbook, with Windows 7
If you zoom out you'll se a strange thing ;)
lf = love.filesystem
ls = love.sound
la =
lp = love.physics
lt = love.thread
li = love.image
lg =

Party member
Posts: 1206
Joined: Wed Nov 02, 2011 9:07 pm

Re: Mario Kart thing

Post by coffee » Fri Jul 13, 2012 11:54 am

retrotails wrote:No gameplay, yet.
It's a start! Looking nice even that when rotating perpective don't seem quite right for now.

@Nixola demo runs +300fps here but the code don't seem for now too much demading.

@Jasoco You did that a long ago (so nobody will take that away from you) but also and unfortunately you didn't even released a tech demo of it (even that is based in your wolfstein engine). So retrotails is now in the lead. ("tails? lead? racing? oh stop try being funny coffee!")

BTW your old wolfstein engine demo runs +70fps here. And seemed solid. Sad that you stopped that because AI factor. You could at least release a super mario kart for 2 players without AI worries. But don't give up of those projects.

It's almost absurd that LOVE don't have 2D racing games (the one only I found in forum is offline) but people want to 3D (ok fake) versions of Super Mario Kart. :D

So please someone do finally a LOVE racing game!

User avatar
Party member
Posts: 555
Joined: Fri Jul 23, 2010 7:55 pm

Re: Mario Kart thing

Post by Tesselode » Fri Jul 13, 2012 2:19 pm

Looks pretty cool, although I think the way the image scales based on distance is a little wrong.

Party member
Posts: 1206
Joined: Wed Nov 02, 2011 9:07 pm

Re: Mario Kart thing

Post by coffee » Fri Jul 13, 2012 2:42 pm

User avatar
Party member
Posts: 212
Joined: Wed Apr 18, 2012 12:37 am

Re: Mario Kart thing

Post by retrotails » Fri Jul 13, 2012 11:58 pm

Updated to 1.1.0 now, see first post.
Can anybody help with the complex math required to draw the sprites? I'm a year behind in highschool math, so... I'd have some difficulty.
Also, can I 'borrow' (with credit of course) a lava kind of shader from somebody?

For those who want to know haw this works, it's all here (main.lua:75)

Code: Select all

for i = 1,screen.height,1 do, i, screen.width, 1), screen.width/2, screen.height/2 + 100, player.rot, i/(128 + player.zoom * 100), i/(128 + player.zoom * 100), player.x, player.y)
Basically, it draws map.tex 1 time for each scanline, scaling it a bit each time. It gets slow at higher resolutions because it has to set the scissor and draw map.tex for every scanline, so on my 1440x900 monitor, it has to draw a 1400x1 strip over and over again 900 times. But it's alot faster then I expected.

User avatar
Posts: 65
Joined: Sun Dec 25, 2011 10:25 am

Re: Mario Kart thing

Post by richapple » Sat Jul 14, 2012 1:12 pm

That looks very good! I myself was working on something similar about 2 month ago. Yours is better :3

Also, it uses quads (for small perfomance boost), but I am not sure if it is the proper use for them

Ok, here it is:
don't laugh
(169.11 KiB) Downloaded 341 times
  • No player picture
  • Fog
  • Bad case of programmer art
  • Low perfomance
  • FOV glitches
Good luck on your project and don't abandon it!

User avatar
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands

Re: Mario Kart thing

Post by Robin » Sat Jul 14, 2012 2:09 pm

Still, pretty nice. The player goes way too fast, though.
Help us help you: attach a .love.

Post Reply

Who is online

Users browsing this forum: kal_drey and 23 guests