Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.
Programming Games
The 10 minute crash course
Rails Girls The Hague 2013
Name: Patrick Huesler
Email: patrick.huesler@wooga.com
Github: phuesler
Twitter: phuesler
Read User Input
Update Game World
Draw Game World
Game Loop
Drawing
Pixel
GPU
Frame rate (FPS)
~60 frames per second
~30 frames per second
x
y
0,0
frames
frame 1 frame 2 frame 3 frame 4 frame 5
Animations
Sprites
x
y
0,0
P(10, 5)
x = 10
y = 5
School
x
y
0,0
P(10,5)
x = 10
y = 5
Computer graphics
x
y
0,0
width
height
Update
Game World
X
Y
0,0
Movement
-y
+y
-x +x
ground
X
Y
0,0
Falling
vy : vertical velocity
vy > 0
ground
y = y + vy
vy
X
Y
0,0
Jumping
vy : vertical velocity
vy < 0
ground
y = y + vy
vy
x
y
0,0
Hit Detection
Hit Boxes:
Are the
rectangles
overlapping?
5,10
15,5
width
height
https://en.wikipedia.org/wiki/Hit-...
x
y
0,0
Center
xc = x + height / 2
yc = y + widht / 2
xc = 5 + 11 / 2 = 8
yc = 5 + 11 / 2 = 8
center = p(8, 8)
5,5
width =...
x
y
0,0
Distance
https://en.wikipedia.org/wiki/Pythagorean_theorem
cTrollX - cRacoonX
cTrollY-cRacoonY
distance = sqrt(a^2...
Ruby GOSU
https://github.com/jlnr/gosu/
https://github.com/jlnr/gosu/wiki/Window-Main-Loop
RG Tutorial*
https://github.com/FloorD/gosu_tutorial_RG_TH
*work in progress
Images
http://www.flickr.com/photos/71753457@N00/2490975442/ orangeacid
http://www.flickr.com/photos/83542829@N00/2778794704...
Programmin games - A 10 minute crash course
Programmin games - A 10 minute crash course
Programmin games - A 10 minute crash course
Programmin games - A 10 minute crash course
Programmin games - A 10 minute crash course
Nächste SlideShare
Wird geladen in …5
×

Programmin games - A 10 minute crash course

4.144 Aufrufe

Veröffentlicht am

Introduction to simple 2D game programming illustrating the basic concepts behind frame rates, animations, movement and hit detection leading into a tutorial and 2 sample applications written in Ruby for Rails Girls The Hague 2013.

Veröffentlicht in: Technologie, Business
  • I Got The Full File, I Just Wanna Share to You Guyszz.. It's Working You Can The Download The Full File + Instructions Here : http://gg.gg/setupexe
       Antworten 
    Sind Sie sicher, dass Sie …  Ja  Nein
    Ihre Nachricht erscheint hier
  • xc = x + width / 2 ?
       Antworten 
    Sind Sie sicher, dass Sie …  Ja  Nein
    Ihre Nachricht erscheint hier

Programmin games - A 10 minute crash course

  1. 1. Programming Games The 10 minute crash course Rails Girls The Hague 2013
  2. 2. Name: Patrick Huesler Email: patrick.huesler@wooga.com Github: phuesler Twitter: phuesler
  3. 3. Read User Input Update Game World Draw Game World Game Loop
  4. 4. Drawing
  5. 5. Pixel
  6. 6. GPU
  7. 7. Frame rate (FPS) ~60 frames per second ~30 frames per second
  8. 8. x y 0,0 frames frame 1 frame 2 frame 3 frame 4 frame 5
  9. 9. Animations
  10. 10. Sprites
  11. 11. x y 0,0 P(10, 5) x = 10 y = 5 School
  12. 12. x y 0,0 P(10,5) x = 10 y = 5 Computer graphics
  13. 13. x y 0,0 width height
  14. 14. Update Game World
  15. 15. X Y 0,0 Movement -y +y -x +x ground
  16. 16. X Y 0,0 Falling vy : vertical velocity vy > 0 ground y = y + vy vy
  17. 17. X Y 0,0 Jumping vy : vertical velocity vy < 0 ground y = y + vy vy
  18. 18. x y 0,0 Hit Detection Hit Boxes: Are the rectangles overlapping? 5,10 15,5 width height https://en.wikipedia.org/wiki/Hit-testing
  19. 19. x y 0,0 Center xc = x + height / 2 yc = y + widht / 2 xc = 5 + 11 / 2 = 8 yc = 5 + 11 / 2 = 8 center = p(8, 8) 5,5 width = 11 height=11c
  20. 20. x y 0,0 Distance https://en.wikipedia.org/wiki/Pythagorean_theorem cTrollX - cRacoonX cTrollY-cRacoonY distance = sqrt(a^2 + b^2) distance a b
  21. 21. Ruby GOSU https://github.com/jlnr/gosu/
  22. 22. https://github.com/jlnr/gosu/wiki/Window-Main-Loop
  23. 23. RG Tutorial* https://github.com/FloorD/gosu_tutorial_RG_TH *work in progress
  24. 24. Images http://www.flickr.com/photos/71753457@N00/2490975442/ orangeacid http://www.flickr.com/photos/83542829@N00/2778794704/ William Hook http://www.flickr.com/photos/60648084@N00/2462966749/ Ѕolo http://www.flickr.com/photos/34196372@N04/5906065484/ Keith Bloomfield http://www.flickr.com/photos/99652207@N00/421447321/ Charles Williams http://www.flickr.com/photos/97223988@N00/6432357463 Flооd http://www.flickr.com/photos/45145879@N00/47714548/" 4tik http://www.flickr.com/photos/89455291@N00/4402938286 Fr3d.org http://www.flickr.com/photos/14443853@N07/5362778675 superUbO http://www.flickr.com/photos/26291754@N02/3720812250 Jen Son http://www.flickr.com/photos/14384226@N07/4768786395 Matteo Sorba

×