Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
20 June, 2013, 13:59:26 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: 1 [2] 3   Go Down
  Print  
Author Topic: How do you make games with coding??? -  (Read 1145 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
BlakPilar
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: 20 February, 2013, 02:38:22
Date Registered: 16 July, 2011, 02:50:55
Posts: 735


Total Post Ratings: +43

View Profile
« Reply #15 on: 25 February, 2012, 18:29:51 »
0

Did you watch the video? To do what you asked, you would just update everything that needs to be updated when your update method is called. Here's some pseudocode to demonstrate what I mean:

update:
    move ball based on travelling direction
    if ball collides with wall or paddle
        method to make ball bounce off of surface
    if ball has passed some paddle
        add point to winner
        reset ball location
    if user presses a key we will use (i.e. Up, Down, W or S)
        update player's paddle location
    update AI
draw:
    clear background
    draw scores
    draw walls
    draw ball

Basically after each draw method is done, the update method will be called, and when each update method is done the draw method will be called.
Logged
Pages: 1 [2] 3   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.268 seconds with 32 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.