Click here to Skip to main content
15,867,568 members
Articles / Game Development

Paper Down Hill

Rate me:
Please Sign up or sign in to vote.
4.75/5 (3 votes)
27 Jul 2013CPOL2 min read 8K   2   2
A four-player soap-box time-trial game with a twist.

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.

Image 1

Introduction

"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.   

Overview 

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.

Image 2 

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.

Image 3 

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

Development 

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
		repeat
			repeat
				ShowImageCaptureScreen()
				repeat
					sync()
				until ISCAPTURINGIMAGE() =0
				NewHeadImg[ImagesTaken]=GETCAPTUREDIMAGE()
			until NewHeadImg[ImagesTaken]>0
			ImagesTaken = ImagesTaken+1
       	 	until ImagesTaken>2
		//mod images
		ImagesTaken=0
		repeat
			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
							SetMemblockByte(HeadMemBlk,offset,0)
						endif
					else
						offset = row*imgW*4+col*4+15
						SetMemblockByte(HeadMemBlk,offset,0)
					endif
				next col
			next row
			ModHeadImg[p,ImagesTaken] = CreateImageFromMemblock(HeadMemBlk)
			ImagesTaken = ImagesTaken+1
		until ImagesTaken>2
	next p
endif 

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 . 

History

[2013.07.27] - Initial draft.

License

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


Written By
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.

Comments and Discussions

 
AdminThanks for entering the Intel AIC 2013! Pin
Kevin Priddle15-Aug-13 9:20
professionalKevin Priddle15-Aug-13 9:20 
GeneralMy vote of 4 Pin
Ahmed Bensaid28-Jul-13 23:14
professionalAhmed Bensaid28-Jul-13 23: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.