Author Topic: How do you make games with coding???  (Read 11330 times)

0 Members and 1 Guest are viewing this topic.

Offline runeazn

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 191
  • Rating: +5/-3
    • View Profile
How do you make games with coding???
« on: February 25, 2012, 10:24:00 am »
I still dont get how you can make games with coding after getting a little taste of coding language python :P

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: How do you make games with coding???
« Reply #1 on: February 25, 2012, 10:27:03 am »
Basically, what most games do is repeat one or more loops to get everything done (with routines and stuff).

btw you better make your questions more closed. (like "how do i code feature x as seen in game y")
« Last Edit: February 25, 2012, 10:28:23 am by aeTIos »
I'm not a nerd but I pretend:

Offline runeazn

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 191
  • Rating: +5/-3
    • View Profile
Re: How do you make games with coding???
« Reply #2 on: February 25, 2012, 10:28:09 am »
how the heck can a loop show something?
ok itll loop the draw comment everytime.

but ho wdoes it pickup if lets say a picture bumps onto another picture, and this results into a movement of the other picture?
« Last Edit: February 25, 2012, 10:28:56 am by runeazn »

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: How do you make games with coding???
« Reply #3 on: February 25, 2012, 10:31:15 am »
In a modern programming language, you have a display routine that draws stuff to the screen. (for example called void draw{ } ). This routine is called every frame.
« Last Edit: February 25, 2012, 10:31:54 am by aeTIos »
I'm not a nerd but I pretend:

Offline runeazn

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 191
  • Rating: +5/-3
    • View Profile
Re: How do you make games with coding???
« Reply #4 on: February 25, 2012, 10:32:00 am »
display routine?

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: How do you make games with coding???
« Reply #5 on: February 25, 2012, 10:37:35 am »
Yeah, its a routine that does display stuff. Like displaying pictures or text.
I'm not a nerd but I pretend:

Offline runeazn

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 191
  • Rating: +5/-3
    • View Profile
Re: How do you make games with coding???
« Reply #6 on: February 25, 2012, 10:39:35 am »
but how does it detect that a pictures collides with another picture and that the other picture needs to move.

lets say, user, bumps against a box and box needs to move.

what i think you do:
 do you code that if that picture is within this area of this picture than this will happen?

is this true?
and whats maa more efficient way to do this?
« Last Edit: February 25, 2012, 10:41:32 am by runeazn »

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: How do you make games with coding???
« Reply #7 on: February 25, 2012, 10:41:42 am »
It does not. It's got coordinates of both things and checks if they are close enough if so, move the box.
I'm not a nerd but I pretend:

Offline runeazn

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 191
  • Rating: +5/-3
    • View Profile
Re: How do you make games with coding???
« Reply #8 on: February 25, 2012, 10:45:45 am »
aha ok,
how do you store the said "picture"

in a variable?


and how can it read the said picture? I dont think it cant read jpg or something can it?
« Last Edit: February 25, 2012, 10:46:14 am by runeazn »

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: How do you make games with coding???
« Reply #9 on: February 25, 2012, 10:50:15 am »
All modern programming languages can read jpg. (png is used more)
And they "store" those pictures by telling the program that "this file is a picture"
I'm not a nerd but I pretend:

Offline runeazn

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 191
  • Rating: +5/-3
    • View Profile
Re: How do you make games with coding???
« Reply #10 on: February 25, 2012, 10:56:38 am »
so it calls a img everytime ok.

how does it get continuously the "keys" of movement?

all i have worked up till now is the input command but it will wait till something is inputted and after that it would continue.
This would be no plausible solution to use right?
how do we do it now?

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: How do you make games with coding???
« Reply #11 on: February 25, 2012, 11:01:16 am »
Programs take keycodes. Every key on a keyboard has a different signal. The program reads the signal every loop and just continues when there's no key pressed.
I'm not a nerd but I pretend:

Offline BlakPilar

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 734
  • Rating: +44/-1
    • View Profile
Re: How do you make games with coding???
« Reply #12 on: February 25, 2012, 11:07:43 am »
All games come down to the basic game life cycle. I recommend watching this video. Though it's for XNA (.NET) and not Python, it gives a pretty detailed overview and explanation of the life cycle.

Offline runeazn

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 191
  • Rating: +5/-3
    • View Profile
Re: How do you make games with coding???
« Reply #13 on: February 25, 2012, 11:22:56 am »
lets say pong, how do you let the ball move from direction?

or better said how do you move a object without user input.

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: How do you make games with coding???
« Reply #14 on: February 25, 2012, 11:25:04 am »
Do (ballpos)+1->ballpos every loop.
I'm not a nerd but I pretend: