Can't figure this out: (hacked aliens) LOH

Not sure if anyone remembers but I’m writing Linux Outdoor Hunter. My code was
primative so I decided to use Sam’s techniques from aliens. But so far, all it
does is come up, move my elk one time(you can also move the site while the elk
is moving) then quit? Any suggestions, here’s the code:
Also the tar file with all images is at www.concentric.net/~linuxguy

-------------- next part --------------
A non-text attachment was scrubbed…
Name: loh.cpp
Type: text/x-c
Size: 7285 bytes
Desc: Source code to LOH
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20000514/14229bca/attachment.bin

In your RunGame() method, you have your return statement in your while
loop, so it exits after one iteration of the loop.

Try stepping through your program with a debugger in the future before
you post to the newsgroup, it will save you a lot of trouble.

Hope this helps,
–Ryan

“Tony M.” wrote:>

Not sure if anyone remembers but I’m writing Linux Outdoor Hunter. My code was
primative so I decided to use Sam’s techniques from aliens. But so far, all it
does is come up, move my elk one time(you can also move the site while the elk
is moving) then quit? Any suggestions, here’s the code:
Also the tar file with all images is at www.concentric.net/~linuxguy


             Name: loh.cpp

loh.cpp Type: cpp files (text/cpp)
Encoding: base64
Description: Source code to LOH

Hey thanks, can you recomend a good debugger.
Hopefully that will fix it, won’t know till I get
home.
-Tony M.
— “Ryan J. Evans” wrote:> In your RunGame() method, you have your return

statement in your while
loop, so it exits after one iteration of the loop.

Try stepping through your program with a debugger in
the future before
you post to the newsgroup, it will save you a lot of
trouble.

Hope this helps,
–Ryan

“Tony M.” wrote:

Not sure if anyone remembers but I’m writing Linux
Outdoor Hunter. My code was
primative so I decided to use Sam’s techniques
from aliens. But so far, all it
does is come up, move my elk one time(you can also
move the site while the elk
is moving) then quit? Any suggestions, here’s the
code:
Also the tar file with all images is at
www.concentric.net/~linuxguy


             Name: loh.cpp

loh.cpp Type: cpp files (text/cpp)
Encoding: base64
Description: Source code to LOH


Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.

GEM Products wrote:

I use gdb, because that’s what I have. If you’re not comfortable with a
command line version of gdb, you might wish to use ddd or xxgdb or some
other frontend to it.

(This, of course, makes the assumption that you’re running on a system
that has gdb. If you’re not, then you’re probably already using an IDE,
so it’s probably got an editor built in…)

–Ryan>

Hey thanks, can you recomend a good debugger.
Hopefully that will fix it, won’t know till I get
home.
-Tony M.
— “Ryan J. Evans” <@Ryan_J_Evans> wrote:

In your RunGame() method, you have your return
statement in your while
loop, so it exits after one iteration of the loop.

Try stepping through your program with a debugger in
the future before
you post to the newsgroup, it will save you a lot of
trouble.

Hope this helps,
–Ryan

“Tony M.” wrote:

Not sure if anyone remembers but I’m writing Linux
Outdoor Hunter. My code was
primative so I decided to use Sam’s techniques
from aliens. But so far, all it
does is come up, move my elk one time(you can also
move the site while the elk
is moving) then quit? Any suggestions, here’s the
code:
Also the tar file with all images is at
www.concentric.net/~linuxguy


             Name: loh.cpp

loh.cpp Type: cpp files (text/cpp)
Encoding: base64
Description: Source code to LOH


Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/

Hey thanks, can you recomend a good debugger.
Hopefully that will fix it, won’t know till I get
home.
-Tony M.

Try GDB :slight_smile:

Nicholas

Not sure if anyone remembers but I’m writing Linux Outdoor Hunter. My code was
primative so I decided to use Sam’s techniques from aliens. But so far, all it
does is come up, move my elk one time(you can also move the site while the elk
is moving) then quit? Any suggestions, here’s the code:
Also the tar file with all images is at www.concentric.net/~linuxguy

Having not compiled it to check it out, one thing I saw which /may/ cause
problems like this is that the EraseObject() code is almost exactly like
SL’s aliens. In aliens, the background wraps across the screen, but in
yours it seems you just have one big background image that fills the
screen.

In a little educational game I’m working on, I too am using routines based
on aliens. I was having similar troubles until I yoinked the second part
of the EraseObject() code that dealt with background wrapping. After that,
I had no more problems.

I don’t have my source code with me (at work) and I haven’t yet posted it
online (too buggy and embarrassing ;). If I remember, I’ll submit my
modified EraseObject() code either to you or this mailing list. (If I
forget, remind me at hart at physics.arizona.edu)On Sun, 14 May 2000, Tony M. wrote:


Sam Hart http://www.physics.arizona.edu/~hart/
Web Page Highlights: Video Game History, Black Hole Simulation, & more.
OTHER WEB SITES MAINTAINED BY SAM HART
http://www.geekcomix.com/ - Geekcomix, the Daily Geek Comic Strip Site
http://www.physics.arizona.edu/~hart/gw/ - Ghostworks (Alt./Linux Computing)

If you can, you can send
it here, or to linuxguy at concentric.net. Hey thanks for
the advise, tonight i’ll know what difference it
makes. Whats problem’s were you seeing. I see that my
background doesn’t get refreshed to well.

okay, my current working source is online at

http://www.physics.arizona.edu/~hart/temp/

there is a readme file which gives a bit of info about the game (that it
will be an educational typing tutor game for kiddies). there are also a
couple of screen shots and (of course) the tarball (which is large
primarily due to my images).

The code specifically that I’ve used (which is a modification of SL’s
aliens DrawObject(), EraseObject(), etc. routines) is located in the file
"playgame.c" from around lines 58 to 97 (and are called, DrawObject(),
UpdateScreen() and EraseObject()… oddly enough :wink:

In these routines I made minor modifications to accomodate for what I was
doing in my code. I hope they help you find a solution to your problem.

(also, ignore all of the included documentation, as the code isn’t up to
the point of the documentation. See the readme.txt at the above web-site
for info.)–
Sam Hart http://www.physics.arizona.edu/~hart/
Web Page Highlights: Video Game History, Black Hole Simulation, & more.
OTHER WEB SITES MAINTAINED BY SAM HART
http://www.geekcomix.com/ - Geekcomix, the Daily Geek Comic Strip Site
http://www.physics.arizona.edu/~hart/gw/ - Ghostworks (Alt./Linux Computing)