Welcome to DU! The truly grassroots left-of-center political community where regular people, not algorithms, drive the discussions and set the standards. Join the community: Create a free account Support DU (and get rid of ads!): Become a Star Member Latest Breaking News Editorials & Other Articles General Discussion The DU Lounge All Forums Issue Forums Culture Forums Alliance Forums Region Forums Support Forums Help & Search

LAS14

(15,167 posts)
Sun May 11, 2025, 12:24 PM 22 hrs ago

Where might I have seen a link to an example of gaming programming?

I was a programmer all my professional life, but I'm 81 and retired over 10 years ago and never got near programming on the web. I've been curious about what code for controlling a game looks like, and saw a link somewhere a few days that looked like it would be just that. I don't know if it was on DU or not, but a search of DU for "gaming" only shows Subjects, not content.

Ideas?

Thanks,
LAS

3 replies = new reply since forum marked as read
Highlight: NoneDon't highlight anything 5 newestHighlight 5 most recent replies
Where might I have seen a link to an example of gaming programming? (Original Post) LAS14 22 hrs ago OP
Look for Steam programing Inkey 22 hrs ago #1
I googled example of gaming programming Jim__ 22 hrs ago #2
Perfect!! Thanks so much. nt LAS14 18 hrs ago #3

Inkey

(388 posts)
1. Look for Steam programing
Sun May 11, 2025, 12:38 PM
22 hrs ago

They have been active in creating and
updating game programs for a while now.

Jim__

(14,722 posts)
2. I googled example of gaming programming
Sun May 11, 2025, 12:52 PM
22 hrs ago

Here's the quick answer from AI:


A simple example of game programming involves creating a basic interactive element, like a character that moves in response to player input. This could be done using a scripting language like Lua, Python, or JavaScript within a game engine, or even with C++ for lower-level game development.
Here's a simplified example using a hypothetical GameEngine and Lua:


-- Define a player character object
player = {
x = 0, -- Initial x position
y = 0, -- Initial y position
speed = 5, -- Movement speed
}

-- Function to handle player input
function handleInput(input)
if input == "left" then
player.x = player.x - player.speed
elseif input == "right" then
player.x = player.x + player.speed
end
end

-- Game loop function
function gameLoop()
-- Check for input (e.g., keyboard input)
if (GameEngine.getKeyPress("left&quot ) then
handleInput("left&quot
elseif (GameEngine.getKeyPress("right&quot ) then
handleInput("right&quot
end

-- Update the game world (e.g., display the character)
GameEngine.drawCharacter(player.x, player.y)

-- Call the game loop again after a delay
GameEngine.setNextFrame(gameLoop)
end

-- Start the game
GameEngine.startGame(gameLoop)
Latest Discussions»Culture Forums»Gaming»Where might I have seen a...