Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,427 members, 7,819,555 topics. Date: Monday, 06 May 2024 at 06:04 PM

Processing Games And Tangible User Interface - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Processing Games And Tangible User Interface (4275 Views)

User Interface Design For The Beginning Web Programmmer / Game Using Tangible Using User Interface / Help, In Choosing A Tangible And Successful Career. (2) (3) (4)

(1) (2) (Reply) (Go Down)

Processing Games And Tangible User Interface by Nobody: 12:47pm On Mar 01, 2013
Hi guys got a projects for School here (MiddleSex) we are meant to create a game with processing and control elements with the Camera, does anyone have a good framework structure for creating games in Processing will save me the stress, or if you got any idea that can help out, i am trying to make things so Modular that it will be easy to introduce Entity without issues. e.g Game Engine Class, Player Class, GameLevel class and that type of sort, thanks a lot
Re: Processing Games And Tangible User Interface by ofeseluayakata(m): 9:12pm On Mar 01, 2013
What type of game?
What platform?
Which programming languages?
Can you give an example of a game that closely resembles what you are trying to achieve.
Re: Processing Games And Tangible User Interface by WhiZTiM(m): 7:25am On Mar 02, 2013
try my favorite OpenCV.
www.opencv.org
Re: Processing Games And Tangible User Interface by Nobody: 10:21am On Mar 02, 2013
Thanks but the course requires Processing, the game is simple fruits fall from the sky, and you use the basket to capture the fruits, except that it uses ReActiVision, to capture Fudicials markers on the Tangible Object and updates the position of the Basket based on how you move the object in real life, the movement is captured by the camera in Real-Time and updates the basket on screen, i have already abstracted the whole entity, my request is if anyone has worked with processing, so i can know the best Game Structure for processing, something like a "boilerplate".
Re: Processing Games And Tangible User Interface by Bassie(m): 11:58am On Mar 02, 2013
Hi, been there, done that - a long time ago(Recreated Super Mario). There arent any "Framework" as such, infact Processing can be seen as a Framework - with Just a bunch of extra classes added on top of the Standard Java Classes.There are however tons of Other Frameworks implemented in other Languages(Kivy - built on python), but this Coursework has to be implemented with a Java Framework(unless things have changed now) and processing seems to be the best(and probably the only) Java Framework that has classes for that.
This is what i did,You can modify my approach to suit you. Your Base class should contain only methods required to "start" the game up, like init(),setup(),draw(). Then every other Utility Method should be Placed in a Different Class with methods definition accepting Objects of your main class.For Instance, in your Fruit Case, methods that control movement of the fruit should be in another class.

About a boiler plate BB, i might still have one somewhere, would check.
I hope i have been able to help. Wishing you all the best. Holla Back, if stuck!
Re: Processing Games And Tangible User Interface by Nobody: 8:07pm On Mar 03, 2013
Already a structure that fits me, but not done yet, i shud be done tonight since i got to show the lecturer tomorrow.
Re: Processing Games And Tangible User Interface by Nobody: 6:53am On Mar 04, 2013
/**
*@author Okeowo Aderemi
*@description A Simple Boilerplate to serve as Processing Game Engine
**/

class GameEngine{


private StageDisplayable _levelHandler;
private AudioPlayer _soundManager;
private Panel _statusPanel;

void addLevel(StageDisplayable obj){
//if the current level is null then add to it if not make null
if(null == _levelHandler){
_levelHandler=null;
_levelHandler=obj;

}
_levelHandler=obj;

}

StageDisplayable getLevel(){
return this._levelHandler;
}

void render(){
if(this._levelHandler == null){
println("**There is no Level to Render**"wink;
}
this._levelHandler.draw();
}

void setSoundManager(AudioPlayer sound){
if(null != _soundManager){
_soundManager=null;
_soundManager=sound;

}
}

AudioPlayer getSoundManager(){
return _soundManager;
}

Panel getStatusPanel(){
return _statusPanel;
}

void setStatusPanel(Panel panel){
if(null != _statusPanel){
_statusPanel=null;
_statusPanel=panel;

}
}
}
/**
*@description Anything to be drawn on the stage must fulfill setup and draw since interface is missing
**/
interface StageDisplayable{
public void setup();
public void draw();
}
/**
*@description A Level that takes and draws the interface to the screen
**/

class Panel{
private int time;
private String stageStatus;
private int scoresStatus;


}
/**
*StateMachine to Hold the Game States
**/
static class StateMachine{
public static int StateMachine=0;
private static final int GameState_SPLASHSCREEN=1;
private static final int GameState_MAINSCREEN=2;
private static final int GameState_SELECTSCREEN=4;
private static final int GameState_GAMESTART=8;
private static final int GameState_GAMETIMEOUT=16;
private static final int GameState_GAMEOVER=32;
private static final int GameState_HIGHSCORES=64;
}

Re: Processing Games And Tangible User Interface by Nobody: 7:00am On Mar 04, 2013
still WIP, ignore some of the comments, was half-sleeping
Re: Processing Games And Tangible User Interface by Nobody: 10:08am On Mar 04, 2013
Sorry i forgot to mention this uses the Minim Audio and am still thinking of adding fisicia.but sadly i crashed my Linux and Win 8 boot, so am stuck today sad not an excuse the teachers will want to hear.
Re: Processing Games And Tangible User Interface by Bassie(m): 4:09pm On Mar 04, 2013
@pc_guru, i hope you are back to speed now?
Re: Processing Games And Tangible User Interface by Nobody: 7:37am On Mar 05, 2013
yep fixed it, i messed up the GRub for Linux but am good now, and the code worked the lecturer liked it and wants me to work on the framework, he might add it as the structure if it is good
Re: Processing Games And Tangible User Interface by Nobody: 7:39am On Mar 05, 2013
//Using the Code

import ddf.minim.*;


//Add Global Declarations Here
GameEngine appEngine;

void setup(){
//change the game state to splashscreen
StateMachine.StateMachine=StateMachine.GameState_SPLASHSCREEN;

size(504,700);
fill(233,200,190, cool;
//Setup the GameEngine
appEngine=new GameEngine();
}

void draw(){
if(StateMachine.StateMachine == StateMachine.GameState_SPLASHSCREEN){
//render the splash screen
appEngine.addLevel(new SplashScreen());
appEngine.render();
}
else if(StateMachine.StateMachine == StateMachine.GameState_MAINMENU){
appEngine.addLevel(new MainMenu());
appEngine.render();
}
else if(StateMachine.StateMachine == StateMachine.GameState_SELECTSCREEN){
appEngine.addLevel(new GameMenu());
appEngine.render();
}

}
Re: Processing Games And Tangible User Interface by Nobody: 1:22pm On Mar 05, 2013
@Bassie have you heard of TUIO "Tangible User Interface Object" i'm thinking of implementing that too to this structure
Re: Processing Games And Tangible User Interface by Bassie(m): 7:15am On Mar 06, 2013
pc guru: @Bassie have you heard of TUIO "Tangible User Interface Object" i'm thinking of implementing that too to this structure

Yea, they are Processing Libraries(i think there are about two), that provide a "bridge" between the Processing Language and reactvision.
Re: Processing Games And Tangible User Interface by Nobody: 8:02am On Mar 06, 2013
yep exactly,i will try to update and change some stuff, because i want each levels to inherit interface that will mirror TUIO Callbacks so that each level is responsible for handle logics during TUIO Events thus free the main app from coupling. if it is a terrible idea please let me know, to me it seems sane to some level only disadvantage is that you get to have multiple files but no coupling and good modularity.
Re: Processing Games And Tangible User Interface by Nobody: 8:58am On Mar 06, 2013
This is WIP Screenshot so far also why does processing hang Windows 8 its freaking terrible, thank God for options

Re: Processing Games And Tangible User Interface by Nobody: 5:38pm On Mar 06, 2013
sorry but i will be offline for a long time, but tomorrow i would love to send a copy of the code to you bassie.
Re: Processing Games And Tangible User Interface by Bassie(m): 7:42pm On Mar 06, 2013
@pc_guru, Nay Problem. Lovely Design by the way.With a wild guess, that's PDE 1.5 you using?, i would advice that you check what PDE environment runs the Table top you would be testing on(my guess is that it might be 1.2), so you dont have some custom methods that are not backward compatible with PDE 1.2( or what ever Demo Env your lecturer would have). There are other walkarounds to this, but avoiding this scenario is usually the best.
Re: Processing Games And Tangible User Interface by Nobody: 8:07pm On Mar 06, 2013
i will check with Course Module, yeah thanx alot i would have forgotten about that.
Re: Processing Games And Tangible User Interface by Nobody: 5:27pm On Mar 12, 2013
@bassie wanna ask for some advice,am suppose to create fruits falling and baskets catch them, i have 2 options handle that logic myself or use the fisica library, not sure which to take. because i will also render splitscreen for 2 players.
Re: Processing Games And Tangible User Interface by Bassie(m): 9:44am On Mar 13, 2013
pc guru: @bassie wanna ask for some advice,am suppose to create fruits falling and baskets catch them, i have 2 options handle that logic myself or use the fisica library, not sure which to take. because i will also render splitscreen for 2 players.

Im not too sure on which approach to adopt. Didn't use the fisica library - but the examples on their site look interesting. If fisica seems an overkill for your task, you could implement it yourself.The fewer dependencies, the better. Wishing you the very best. As another tip, your Lecturers would give you a better grade if your game explores some(if not all) concept(s) of the RBI framework.
Re: Processing Games And Tangible User Interface by Nobody: 8:40am On Mar 19, 2013
Here is a demo to the Current Work in Progress,thanx alot bassie for the support, lecturer liked it but still got work.

https://www.youtube.com/watch?v=n6RwWrThr3E
[img]
https://www.youtube.com/watch?v=n6RwWrThr3E[/img]
Re: Processing Games And Tangible User Interface by Bassie(m): 9:13am On Mar 19, 2013
It's Wonderful. Well Done. If you can, you could make it collaborative - having two baskets with the second one controlled by a second player, with the winner of the game being the one with most fruit picks.
Wishing you all the best though
Re: Processing Games And Tangible User Interface by Nobody: 3:07pm On Mar 19, 2013
dude you must be a mind reader, actually thats the next phase, rendering dual screen so 2 players can play simultaneously but mehn i hope fisica can handle double the calculation.
Re: Processing Games And Tangible User Interface by Nobody: 9:58am On Jun 19, 2013
The Final video of the Game,
[flash=400,400]
https://www.youtube.com/watch?v=J2YaZf4bCPI[/flash]
Thanks to your support @bassie I got an A, it was the best project. just wanted to put the link

1 Like

Re: Processing Games And Tangible User Interface by Sicozone(m): 11:37am On Jun 19, 2013
multiply ur age *259*39....if u
get an interesting answer,like
this.....

1 Like

Re: Processing Games And Tangible User Interface by Nobody: 11:47am On Jun 19, 2013
Sicozone: multiply ur age *259*39....if u
get an interesting answer,like
this.....

not bad
Re: Processing Games And Tangible User Interface by DAvIt0(m): 3:41pm On Jun 19, 2013
Whole Thread Piece... Got me inspired
Re: Processing Games And Tangible User Interface by DAvIt0(m): 3:56pm On Jun 19, 2013
pc guru:

and your point is ?
I think I get it .. Quite cool
Re: Processing Games And Tangible User Interface by Bassie(m): 6:31pm On Jun 19, 2013
@pc_guru So glad to hear that , Congratulations. it seems your Youtube Video is private so i cant view it.
Re: Processing Games And Tangible User Interface by Nobody: 7:33pm On Jun 19, 2013
Bassie: @pc_guru So glad to hear that , Congratulations. it seems your Youtube Video is private so i cant view it.

wow no idea,my tablet must have done that, now public
Re: Processing Games And Tangible User Interface by REDBULL1(m): 1:09pm On Jun 22, 2013
hey fellas, i'm interested in learning Processing. I was taking a free course on it on coursera.org, but i'm totally floating there. Do you guys have any resources you might wanna share to help me with. Plssssssss

(1) (2) (Reply)

Php Vs Python Which Is More Easy!! / Learn Microcontroller PLC Ladder Logic Programming With Ldmicro Free On Youtube / Developing A Facebook-like Ticker For Nairaland

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 37
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.