Hi !
Featured games (87)
games approved by the League of Dukes
Games in Showcase (670)
Games in Android Showcase (194)
games submitted by our members
Games in WIP (727)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  The basic question  (Read 1569 times)
0 Members and 1 Guest are viewing this topic.
Offline Richie_Mole

Junior Newbie

Im a n00bie at this =(

« Posted 2004-06-30 12:03:48 »

O.k how do you make something move on the screen?  Huh  I have been trying so hard to get this right and have looked at many different ways but none of them seem to work properly or just do not work at all. I know you have to redraw the image when you want it to move but how can i do this? I have looked on every tutorial here but they don't give much detail about why they put that peice of code there. So please can some one help me?
Offline DrBizzar0

Junior Devvie

Raj raj!

« Reply #1 - Posted 2004-06-30 13:25:50 »
Offline Richie_Mole

Junior Newbie

Im a n00bie at this =(

« Reply #2 - Posted 2004-06-30 15:58:08 »

Nope doesn't really help it tells you in parts which is confusing for me. All i want to know is a good peice of code that makes a square move up and down on the screen. The rest il figure out when i come 2 it.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline oNyx

JGO Coder

Medals: 2

pixels! :x

« Reply #3 - Posted 2004-06-30 16:34:41 »

the game:

declare variables
make a buffer
load stuff

run as long as it makes sense

clear the buffer (or don't)
change variables accordingly to the input flags (logic)
draw the background on the buffer
draw the sprites on the buffer
draw the hero on the buffer (using those variables)
draw other stuff on the buffer
draw the buffer on the screen



in the input handler:

if key 'x' is down set the flag to 1
if key 'x' in not down set the flag to 0
if key 'esc' is down set "makes sense" to false Wink


That's the whole idea. Of course you need to know how to programm in java - otherwise you won't be able to do much.

弾幕 ☆ @mahonnaiseblog
Offline CodexArcanum

Senior Newbie

Games == Life

« Reply #4 - Posted 2004-06-30 16:38:22 »

Things don't really "move."  You just change their position a little bit every frame.  

Basically, just set the x and y position of it to somewhere onscreen, then increment it every loop.

The webpage he gave seems simple enough.  Just scroll to the movement section and it bascially puts it right there.

Every sprite has an x and y position variable, and you use that to tell it where to draw it at, then you change that variable when the loop restarts, so it appears to move.
Offline Richie_Mole

Junior Newbie

Im a n00bie at this =(

« Reply #5 - Posted 2004-06-30 16:49:30 »

yeah i know things don't move thats what i said in 1st post. I'll look at it again, i hate reading from my computer screen my eyes go funny. I need a TFT monitor (off topic  Lips Sealed).
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

IanParcs (35 views)
2016-04-18 14:18:53

KaiHH (35 views)
2016-04-18 08:35:41

KaiHH (66 views)
2016-04-15 12:43:58

theagentd (66 views)
2016-04-14 02:16:17

theagentd (73 views)
2016-04-14 02:15:43

IanParcs (66 views)
2016-04-12 03:51:16

IanParcs (36 views)
2016-04-12 03:50:03

IanParcs (32 views)
2016-04-12 03:49:54

IanParcs (29 views)
2016-04-12 03:49:52

IanParcs (36 views)
2016-04-12 03:49:52
Website offering 3D Models specifically for games for free
by vusman
2016-04-29 12:56:17

List of Learning Resources
by SilverTiger
2016-02-05 09:39:47

List of Learning Resources
by SilverTiger
2016-02-05 09:38:38

List of Learning Resources
by SilverTiger
2016-02-05 09:35:50

Rendering resources
by Roquen
2015-11-13 14:37:59

Rendering resources
by Roquen
2015-11-13 14:36:58

Math: Resources
by Roquen
2015-10-22 07:46:10

Networking Resources
by Roquen
2015-10-16 07:12:30 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!