Click here to Skip to main content
12,629,804 members (29,714 online)
Click here to Skip to main content
Add your own
alternative version


2 bookmarked

Paper Down Hill

, 28 Jul 2013 CPOL
Rate this:
Please Sign up or sign in to vote.
A four-player soap-box time-trial game with a twist.

Editorial Note

This article is an entry in our AppInnovation Contest. Articles in this sub-section are not required to be full articles so care should be taken when voting.


"Paper Down Hill" is a 2D soap-box time-trial game where up to four players can take part either as a cooperative team, or working against each other. 

The game is aimed at the "All-In-One" platform and the corresponding  "Games"category.   


The game starts by taking 3 pictures of the players (up to four) using the built-in web-cam.  These images are later used for the cart-driver's head in the game as shown below.


The main game then consists of a number of trials selected by the group.

Each trial consists of 2 phases, a 5 second setup phase where everyone gets to adjust the shape of the cart (the size of the wheels, the position of the seat, how fat the driver is).

Then the driver is picked at random and they have to try and make it down the hill as fast as possible without falling out of the cart.


The other, non-driving players help or hinder the driver by throwing objects at them.

A link to a video showing some of the 2D physics in action can be found here


The game is being developed using App Game Kit (AGK) v108, utilising the Tier 1 command set.   AGK's basic Tier1 language enable rapid development for a single develop like me, but also enables easy access to the deeper features within the hardware, such as multi-touch points, the accelerometers, gyros, etc.

For example; the following few lines, cover the image capture and processing: 

//take player photos
dim NewHeadImg[2] as integer
dim ModHeadImg[4,2] as integer 
ImagesTaken = 0
if GetCameraExists()=1
	for p=1 to totalplayers
		//use camera
			until NewHeadImg[ImagesTaken]>0
			ImagesTaken = ImagesTaken+1
       	 	until ImagesTaken>2
		//mod images
			HeadMemBlk = CreateMemblockFromImage(NewHeadImg[ImagesTaken])
			imgW = GetMemblockInt(HeadMemBlk,0)
			imgH = GetMemblockInt(HeadMemBlk,4)
			//ellipse values
			a# = 120.0
			b# = 200.0
			for row = 0 to imgH-1
				for col = 0 to imgW-1
					r# = abs(row-(imgH/2.0))
					if (1.0-((r#/b#)^2))>0.0
						clim = trunc(sqrt((1.0-((r#/b#)^2))*(a#^2)))
						climlo = (imgw/2)-clim
						climhi = (imgw/2)+clim
						if (row<(0.125*imgH) or row>(0.875*imgH) or col<(climlo) or col>(climhi))
							rem *** Calculate offset to alpha value ***
							offset = row*imgW*4+col*4+15
						offset = row*imgW*4+col*4+15
				next col
			next row
			ModHeadImg[p,ImagesTaken] = CreateImageFromMemblock(HeadMemBlk)
			ImagesTaken = ImagesTaken+1
		until ImagesTaken>2
	next p

The initial points of the game are already constructed although there are still large parts to work one such as the majority of the artwork, multi-player and multi-touch implementation.  The idea is relatively simple with a lot of scope to expand on, such as drawing your own hills, or cart components. 

Points of Interest

The game will utilise the multi-touch functionality of the AIO, allowing players to directly drag and through their own sprites around the screen.  

The game also utilises the built-in web game to place the players inside the game . 


[2013.07.27] - Initial draft.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Systems Engineer None
United Kingdom United Kingdom
By day I am a Spacecraft engineer working on interplanetary spacecraft.

By night I write games.

I have been designing games since I was a teenager, starting with board games before branching out into the digital world.

I started video game creation using SEUCK on the Atari ST, making a number of small/ simple shoot-em-ups. I then moved onto using Visual Basic and VBA becoming an active member of the XL gaming forum and creating a number of games such as Cim Sity, Nations and a multiplayer version of Champ Manager (A Football/Soccer management game) within Microsoft Excel. I still play Champy today with my friends and continue to develop it some 5 years after I started writing it.

More recently I have been developing games using Dark Basic Professional (DBPro) and the App Game Kit (AGK). With the former I have created a number of FPS's and released a number of free demos. With the later I have created a number of 2D games for the Blackberry PlayBook and for Windows 8 Ultrabooks.

You may also be interested in...


Comments and Discussions

AdminThanks for entering the Intel AIC 2013! Pin
Kevin Priddle15-Aug-13 10:20
staffKevin Priddle15-Aug-13 10:20 
GeneralMy vote of 4 Pin
Ahmed Bensaid29-Jul-13 0:14
professionalAhmed Bensaid29-Jul-13 0:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.161205.3 | Last Updated 28 Jul 2013
Article Copyright 2013 by Ched1980
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid