Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 13 14 [15] 16 17 ... 91

Author Topic: Programming Help Thread (For Dummies)  (Read 100599 times)

Angle

  • Bay Watcher
  • 39 Indigo Spear Questions the Poor
    • View Profile
    • Agora Forum Demo!
Re: Programming Help Thread (For Dummies)
« Reply #210 on: July 19, 2011, 10:53:33 pm »

Heres a resource I found. You might want to learn some basic programming concepts first, though.
Logged

Agora: open-source platform to facilitate complicated discussions between large numbers of people. Now with test site!

The Temple of the Elements: Quirky Dungeon Crawler

MaximumZero

  • Bay Watcher
  • Stare into the abyss.
    • View Profile
Re: Programming Help Thread (For Dummies)
« Reply #211 on: July 19, 2011, 11:10:55 pm »

Classes at the local college have helped a lot, too. I mean, I don't understand most of this, either, but I am starting to get the hang of it.
Logged
  
Holy crap, why did I not start watching One Punch Man earlier? This is the best thing.
probably figured an autobiography wouldn't be interesting

Siquo

  • Bay Watcher
  • Procedurally generated
    • View Profile
Re: Programming Help Thread (For Dummies)
« Reply #212 on: July 20, 2011, 05:30:22 am »

References IIRC just have a stricter set of conditions than pointers
Ah, thanks!
Logged

This one thread is mine. MIIIIINE!!! And it will remain a happy, friendly, encouraging place, whether you lot like it or not. 
will rena,eme sique to sique sxds-- siquo if sucessufil
(cant spel siqou a. every speling looks wroing (hate this))

Angle

  • Bay Watcher
  • 39 Indigo Spear Questions the Poor
    • View Profile
    • Agora Forum Demo!
Re: Programming Help Thread (For Dummies)
« Reply #213 on: July 26, 2011, 08:43:48 pm »

Okey, I'm trying to use ncurses, and am having a bit of trouble. Is there anyway to get the measurements of a window? say, its height, width,  startx and starty? or even just to rotate or flip a window? or does anybody know of a reference or documentation for ncurses? all I've been able to find is a tutorial, but it doesn't cover what I need.

Also, I STILL haven't gotten any feedback on my project.
Logged

Agora: open-source platform to facilitate complicated discussions between large numbers of people. Now with test site!

The Temple of the Elements: Quirky Dungeon Crawler

alfie275

  • Bay Watcher
    • View Profile
Logged
I do LP of videogames!
See here:
http://www.youtube.com/user/MrAlfie275

Angle

  • Bay Watcher
  • 39 Indigo Spear Questions the Poor
    • View Profile
    • Agora Forum Demo!
Re: Programming Help Thread (For Dummies)
« Reply #215 on: July 27, 2011, 02:51:08 pm »

That's a tutorial, not a reference. I've elready read it. It does not contain the information I need. Luckily enough, however, I found this, which does contain the information I need.
Logged

Agora: open-source platform to facilitate complicated discussions between large numbers of people. Now with test site!

The Temple of the Elements: Quirky Dungeon Crawler

Normandy

  • Bay Watcher
    • View Profile
Re: Programming Help Thread (For Dummies)
« Reply #216 on: July 27, 2011, 06:00:40 pm »

@Angle:
The issue is that most programmers aren't going to trawl through your code out of the kindness of their hearts, and most other people don't know how to compile your engine or otherwise provide any sort of meaningful critique of it. That's why you haven't been getting any feedback on your engine. Either get a working demo up or start asking specific questions if you want more feedback.
Logged

Angle

  • Bay Watcher
  • 39 Indigo Spear Questions the Poor
    • View Profile
    • Agora Forum Demo!
Re: Programming Help Thread (For Dummies)
« Reply #217 on: July 27, 2011, 08:13:13 pm »

Mmm. Will do.
Logged

Agora: open-source platform to facilitate complicated discussions between large numbers of people. Now with test site!

The Temple of the Elements: Quirky Dungeon Crawler

ILikePie

  • Bay Watcher
  • Call me Ron
    • View Profile
Re: Programming Help Thread (For Dummies)
« Reply #218 on: July 28, 2011, 07:50:35 am »

That's a tutorial, not a reference. I've elready read it. It does not contain the information I need. Luckily enough, however, I found this, which does contain the information I need.
That looks like a reference for some PHP ncurses package. This might be what you're looking for (scroll down of a list of all the ncurses functions). If you're on Linux, you can access that same page off line by typing "man ncurses" into the terminal.

e, I just noticed the links are broken, just copy and paste the function name into the search bar.
« Last Edit: July 28, 2011, 07:57:27 am by ILikePie »
Logged

Angle

  • Bay Watcher
  • 39 Indigo Spear Questions the Poor
    • View Profile
    • Agora Forum Demo!
Re: Programming Help Thread (For Dummies)
« Reply #219 on: July 28, 2011, 12:31:39 pm »

That is very much what I'm looking for. I can't access it through terminal, though- not with "man ncurses" or "man curses". But that's alright, I'll just use the online version. Thank you very much!
Logged

Agora: open-source platform to facilitate complicated discussions between large numbers of people. Now with test site!

The Temple of the Elements: Quirky Dungeon Crawler

Supermikhail

  • Bay Watcher
  • The Dwarf Of Steel
    • View Profile
Re: Programming Help Thread (For Dummies)
« Reply #220 on: July 29, 2011, 11:46:48 pm »

Guess it counts as a dummy question.

Can Java hate me and purposely skip some lines of my code? Because that's the impession I'm getting. In one 'if' segment (or what should I call the place between brackets) it executes some lines of code and ignores others. Alternatively, it could be that it suddenly desides to break out of a 'switch' because an 'if' segment becomes more relevant. Could it be that Java update bringing an AI into JVM?
Logged

Nadaka

  • Bay Watcher
    • View Profile
    • http://www.nadaka.us
Re: Programming Help Thread (For Dummies)
« Reply #221 on: July 30, 2011, 12:33:00 am »

Unlikely, however Java 7 was recently released by oracle with critical bugs built in that affect loops.

it is most likely a misplaced curley bracket or semi colon or some other coding error, but I would need to see the switch in question.
Logged
Take me out to the black, tell them I ain't comin' back...
I don't care cause I'm still free, you can't take the sky from me...

I turned myself into a monster, to fight against the monsters of the world.

Supermikhail

  • Bay Watcher
  • The Dwarf Of Steel
    • View Profile
Re: Programming Help Thread (For Dummies)
« Reply #222 on: July 30, 2011, 12:47:43 am »

Okay.
Code: [Select]
public void keyPressed(KeyEvent ke) {
if (state == GameState.play) {
switch (ke.getKeyCode()) {
case (KeyEvent.VK_RIGHT):
player.moveWithColDetect(Direction.East);
opponent.step();
Render();
break;

case (KeyEvent.VK_LEFT):
player.moveWithColDetect(Direction.West);
opponent.step();
Render();
break;

case (KeyEvent.VK_UP):
player.moveWithColDetect(Direction.North);
opponent.step();
Render();
break;

case (KeyEvent.VK_DOWN):
player.moveWithColDetect(Direction.South);
opponent.step();
Render();
break;

default:
;
}
if (player.x == opponent.x && player.y == opponent.y) {
state = GameState.loss;
setTitle("Test RL Labyrinth. Loss!");
panel.setGameState(state);
panel.repaint();
}
if (opponent.alerted()) {
if (player.x == entr.getX() && player.y == entr.getY()) {
state = GameState.victory;
setTitle("Test RL Labyrinth. Victory!");
panel.setGameState(state);
panel.repaint();
} else
setTitle("Test RL Labyrinth. Enemy alerted!");
}
} else if (state == GameState.loss) {
start();
Render();
} else if (state == GameState.victory) {
start();
Render();
}
}

My logical circuits tell met that inn the case of, say, victory, the program should go like this:

switch -> it processes input, steps player and opponent, Renders;
if -> finds out that the player is on the entrance tile, sets state for victory, sets title for victory, transmits the state to the drawing panel, makes the drawing panel draw the victory screen.

Well, in reality, my impression is it for some reason goes like this:

switch -> it processes input, steps player and opponent Renders
immediately goes to
if -> finds out that the player is on the entrance tile, sets state for victory (doesn't set title for victory), transmits the state to the drawing panel, makes the drawing panel draw the victory screen.

Who is wrong here - me or it?
Logged

supermalparit

  • Bay Watcher
    • View Profile
    • Towns devblog
Re: Programming Help Thread (For Dummies)
« Reply #223 on: August 01, 2011, 03:29:10 am »

Who is wrong here - me or it?

For sure you are wrong :P

You'll need to debug that code. The fastest way for debugging it's, almost always (!!!), inserting "print" lines before/after conflictive spots and running the game again. The good old school method for debugging!
Logged

Supermikhail

  • Bay Watcher
  • The Dwarf Of Steel
    • View Profile
Re: Programming Help Thread (For Dummies)
« Reply #224 on: August 01, 2011, 11:20:53 pm »

Well, I just had to say that, even after realising how stupid it would sound.

If I'm gonna debug it, it's gonna be a whole lot of println, I expect... So, I wonder if you're supposed to leave all that debugging code in when you're finished, or you should go through the tedious job of cleaning the code back up.

Update: Okay, turns out the drawing panel refused to repain twice at once; consequently, I had to bulk up its code a bit. Ideally, I should now stop the program from calling repaint on the panel twice... Okay, I guess it was time to clean up anyway.
« Last Edit: August 02, 2011, 12:27:39 am by Supermikhail »
Logged
Pages: 1 ... 13 14 [15] 16 17 ... 91