Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


Dezachu

Member Since 02 Aug 2012
Offline Last Active Sep 24 2014 07:10 PM

Topics I've Started

Web App Development?

20 September 2014 - 08:21 AM

Hey guys,

 

I've been a C++ programmer for 3 years now. Dabbled in C#/Unity and Python and recently I was tinkering with an API using C++, cURL and Jsoncpp. One of the apps I've made using said API is pretty good, but it has no place as an executable - why would you use an executable you have to download when you can do the same operation on a website?

 

My knowledge of web development/web app development general is extremely limited. I know a little bit of HTML/CSS and practically nothing else. I've heard of terms such as GET, POST etc but only have a super vague idea of where to start. I'd like some advice on where I should begin if I want to create an app on a website. Would HTML/JS do the job? Do I need to look into PHP? MySQL won't be needed as the API returns all data in Json. 

 

TL;DR Wanting to start developing basic apps to plop on a website, any good resources/tutorials/advice for this?

 

 

Thanks smile.png

 

EDIT: I'm aware this isn't strictly game related, but the API is for a game if that helps! The app I'm thinking of is interactive either way and I've been on these boards for a fair while - probably the best place to ask.


SFML - Key Presses?

28 November 2012 - 03:32 PM

Hi hi,

I'm creating a game for my portfolio and at present it's a simple sprite running around a screen (no rotations or anything implemented yet) and I'm finding a minor issue quite annoying.

If a player is holding down the up key to move vertically and then hits the right key to head right, whilst still holding down the up keupon release of the right key the sprite doesn't move upwards as you'd expect.

I can kind of see why it does what it's doing, but I can't think of a solution. Any ideas?

Here's my input function:

[source lang="cpp"]void Game::getInput(){ sf::Event Event; while (MyGameWindow->GetEvent(Event)) { if (Event.Type == sf::Event::Closed) MyGameWindow->Close(); if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape)) MyGameWindow->Close(); if(Event.Type == sf::Event::KeyPressed) currentKey = Event.Key.Code; if(Event.Type == sf::Event::KeyReleased) currentKey = sf::Key::Numpad9; if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::R)) paused = false; }}[/source]

And then my update function:

[source lang="cpp"]void Game::update(){ if(!paused) { ELAPSED_TIME = myClock.GetElapsedTime(); if (ELAPSED_TIME > FRAMERATE) { switch(currentKey) { case sf::Key::Up: P1.MoveUp(10); break; case sf::Key::Down: P1.MoveDown(10); break; case sf::Key::Left: P1.MoveLeft(10); break; case sf::Key::Right: P1.MoveRight(10); break; case sf::Key:[img]http://public.gamedev.net//public/style_emoticons/default/tongue.png[/img]: paused = true; break; } myClock.Reset(); } }}[/source]



Cheers guys!

Jumpy rotation animation?

10 November 2012 - 07:31 PM

Hey guys, bit of a noob with OpenGL (Only just started utilising it on my course!). C++.

Got this:

[source lang="cpp"]if((float)Clock.GetElapsedTime()>REFRESH_RATE){ // Clear colour and depth buffer glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // reset the ModelView Transform matrix glMatrixMode(GL_MODELVIEW); glLoadIdentity(); // Apply some transformations glTranslatef(0.f, 0.f, -100.f); //glRotatef(15.f,1.f,0.f,0.f); glRotatef(i,0.f,1.f,0.f); glRotatef(i-15,0.f,0.f,1.f); glRotatef(i+15,1.f,0.f,0.f); // ********************** // drawCylinder(20,20,40); // ********************** // i++; Clock.Reset(); }[/source]

The drawCylinder uses to TRIANGLE_FAN objects and then QUAD_STRIP's, all created via a for loop. The parameters passed in are radius, numberOfSides and height.

i++ is a float declared at the beginning of the program: float i = 30; (I know it should be called f for float, but more confusion to be made there that I was better off avoiding).


When I run the program, the animation is very jumpy as it rotates. Any clues as to why? Cheers :)


EDIT: Dropping the framrate from 0.03 to 0.01 has improved it somewhat. Still, I'd imagine the animation would be more stuttery than jumpy. The animation basically flashed back to the previous frame every so often, looked a bit daft.

#pragma once

28 September 2012 - 11:45 AM

Hi hi guys :)

Going into my second year of uni and it's about time I really knuckled down, endured many headaches and cracked on with some C++!

Quick question about '#pragma once'. I know it makes sure a header file is only included once in the compilation. Well, source files, not strictly headers Posted Image

Anyway, I wanted to know if it's worth including this in EVERY header file I write, or is there a particular reason one may wish to repeatedly include a particular file?


Thanks guys!

PARTNERS