Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Programmin games - A 10 minute crash course

4,520 views

Published on

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.

Published in: Technology, 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
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • xc = x + width / 2 ?
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

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

×