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,174 posts)
Sun May 11, 2025, 12:24 PM May 11

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 May 11 OP
Look for Steam programing Inkey May 11 #1
I googled example of gaming programming Jim__ May 11 #2
Perfect!! Thanks so much. nt LAS14 May 11 #3

Inkey

(390 posts)
1. Look for Steam programing
Sun May 11, 2025, 12:38 PM
May 11

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

Jim__

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

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)

Kick in to the DU tip jar?

This week we're running a special pop-up mini fund drive. From Monday through Friday we're going ad-free for all registered members, and we're asking you to kick in to the DU tip jar to support the site and keep us financially healthy.

As a bonus, making a contribution will allow you to leave kudos for another DU member, and at the end of the week we'll recognize the DUers who you think make this community great.

Tell me more...

Latest Discussions»Culture Forums»Gaming»Where might I have seen a...