Videopac / Odyssey2 forum
December 08, 2022, 05:13:45 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: The forum will disappear in April 2023 please check this topic!
 
   Home   Help Login Register links videopac.nl  
Pages: 1 2 [3] 4   Go Down
  Print  
Author Topic: Ants! (a WIP)  (Read 20133 times)
Chris!
Give this man a Jopac!
******
Posts: 1310



WWW
« Reply #30 on: September 17, 2011, 02:36:00 PM »

I tried again with putting some more code in. What I basically did was copy and paste the code for the green guy and tried to put info on how to bounce on the walls. I put this in a call routine since the info on getting the joystick info was this way, too. Instead, I got what I did the first time: A bunch of flashing sprites. Can someone help me with the code I posted and help me actually get this working?
Logged

All my Odyssey2 projects, now in one place!
http://www.atari2600land.com/odyssey2.html
Chris!
Give this man a Jopac!
******
Posts: 1310



WWW
« Reply #31 on: September 19, 2011, 02:38:30 PM »

All I want to do is have the tan ant move around inside the board diagonally and if he hits a wall, go the opposite direction. Why can't I do this?! In Basic, I'd have a variable add every frame, and when it reaches a certain point, move the ant an x and a y direction. Then, if the ant goes past one of the four certain points in the grid, have it change course the opposite directions.
Logged

All my Odyssey2 projects, now in one place!
http://www.atari2600land.com/odyssey2.html
manopac
Game & App Development
Give this man a Jopac!
*
Posts: 1182



« Reply #32 on: September 19, 2011, 04:03:39 PM »

Hey Chris,

sorry, I currently don't have any time to look at your code, but in theory what you do in BASIC is what you would do here as well - for every coordinate (X and Y) you have a memory location where you store either $01 or $FF, if the ant hits the limit you want it to reach (-> the grid), you just change the content of the variable, e.g.


so your code could look something like this:
(PSEUDO CODE !!)

Code:
mov r0,#25       ; this is an example wherever you store the up/down counter    (either +1 or -1 (FF) -> you have to store it there first !!)
mov r1,#26       ; this is an example wherever you store the coordinate

        mov           a,@r0
        mov           r2,a          ; contains now  +1 / -1 (FF)

        mov           a,@r1
        add            a, r2        ; increase / decrease the position
        mov           @r1,a       ; and write it back

; now see if we need to change the counter as we hit a border
        xrl             a,#1Fh      ; e.g. left border
        jz              ChangeCounter

        mov           a,@r1
        xrl             a,#99       ; e.g. right border
        jz              ChangeCounter

Done
        ret

ChangeCounter
        mov       a,r2        ; get the counter
        cpl         a           ; invert it and add 1    ->    1 -> FF,  FF-> 1
        add        a,1
        mov       @r0,a     ; and write it back
        jmp Done


you get the principle ?   (I didn't try to write optimized code but rather one that is understandable, so don't kill me for bad coding style :-) )
Logged

sex, lies, and videopac
Chris!
Give this man a Jopac!
******
Posts: 1310



WWW
« Reply #33 on: September 19, 2011, 04:29:51 PM »

Thanks to Rene, I have updated the code majorly. It's now a lot smaller than it was, but there are a few problems.
#1 - the visible border flickers.
#2 - The tan ant, which I want to move diagonally, is only going down, which is weird because in his example, it says the object should be going left/right.
#3 - The extreme left/right/up/down points for the tan ant and Stan (the little green guy) need to be changed to fit the border.
So, would any one like to look through the new code and see what's going on?
Logged

All my Odyssey2 projects, now in one place!
http://www.atari2600land.com/odyssey2.html
Chris!
Give this man a Jopac!
******
Posts: 1310



WWW
« Reply #34 on: September 19, 2011, 09:29:49 PM »

OK, I got problem #1 and #3 solved on my own, but still need help on problem #2.
Logged

All my Odyssey2 projects, now in one place!
http://www.atari2600land.com/odyssey2.html
Rene_G7400
Pedit5
I take the Videopac and leave the Canoli!
*
Posts: 2519



WWW
« Reply #35 on: September 19, 2011, 10:33:24 PM »

OK, I got problem #1 and #3 solved on my own, but still need help on problem #2.

You've got a PM.
Logged
Chris!
Give this man a Jopac!
******
Posts: 1310



WWW
« Reply #36 on: September 20, 2011, 01:10:47 PM »

OK, the ant is bouncing around the screen. I kind of wanted the x axis movement to be the same as the y axis, but at least it's bouncing around the screen now. Check out the official Ants! homepage at http://www.atari2600land.com/ants/ for a list of stuff I need to do next.
Logged

All my Odyssey2 projects, now in one place!
http://www.atari2600land.com/odyssey2.html
Janzl
Administrator
I'd sell my mother for a Videopac
*****
Posts: 2441


I now can cross that bloody street...


facebook@janzl.com
WWW
« Reply #37 on: September 20, 2011, 01:28:41 PM »

I just tested your game and I must say that I really like the ant-sprite. It's just begs to get animated!
Logged

Ne tirez pas sur le administrator!
Chris!
Give this man a Jopac!
******
Posts: 1310



WWW
« Reply #38 on: September 20, 2011, 05:03:02 PM »

Thanks, I had someone else much more skilled than me at making sprites make that for me. I don't know how I would go about programming animation, or what the extra sprites would look like. You mean the tan ant, right?
Logged

All my Odyssey2 projects, now in one place!
http://www.atari2600land.com/odyssey2.html
Chris!
Give this man a Jopac!
******
Posts: 1310



WWW
« Reply #39 on: September 21, 2011, 12:25:48 AM »

Version 11 is here! Changes are:
Collision detection now works for the tan ant. You only get one life (like in so many other Odyssey2 games) and if you hit the tan ant, press fire to get back to the "GAME SELECT" screen.
The tan ant's speed increases with every twenty black ants you get
I don't know if there was sound in version 9, but I added a sound each time you get an ant.
Logged

All my Odyssey2 projects, now in one place!
http://www.atari2600land.com/odyssey2.html
Rafael
Pedit5
I take the Videopac and leave the Canoli!
*
Posts: 2838



« Reply #40 on: September 21, 2011, 01:48:27 AM »

Chris, you?re doing a nice job. The game is cool, but I tested it on O2em v 1.81 and it not works, having time I?ll test on the real console, but by my experiences it will not work. Sugestion, try other colors, black backgroud ever looks good! Congrats by now.
Logged

Rafael
Pedit5
I take the Videopac and leave the Canoli!
*
Posts: 2838



« Reply #41 on: September 21, 2011, 01:56:10 AM »

In time, my high for while:  51  Wink
Logged

Chris!
Give this man a Jopac!
******
Posts: 1310



WWW
« Reply #42 on: September 21, 2011, 05:55:40 AM »

Where can you get v1.81? I think I have 1.18
Logged

All my Odyssey2 projects, now in one place!
http://www.atari2600land.com/odyssey2.html
Chris!
Give this man a Jopac!
******
Posts: 1310



WWW
« Reply #43 on: September 21, 2011, 06:37:02 PM »

Version 12:
* Changed the joystick you use to the left one.
* Pressing fire at the death starts a new game, and doesn't go back to the GAME SELECT screen.
Logged

All my Odyssey2 projects, now in one place!
http://www.atari2600land.com/odyssey2.html
Rafael
Pedit5
I take the Videopac and leave the Canoli!
*
Posts: 2838



« Reply #44 on: September 22, 2011, 04:10:21 AM »

Where can you get v1.81? I think I have 1.18


Get it here:
http://guttenbrunner.com/videopac/o2em1181win.zip

Now the black ant is over tan ant.
Logged

Pages: 1 2 [3] 4   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!