Denial Forum Index Denial
The Commodore Vic 20 Forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

New Release: KWEEPOUT
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    Denial Forum Index -> Games
View previous topic :: View next topic  
Author Message
Kweepa
Vic 20 Nerd


Joined: 04 Jan 2008
Posts: 811
Location: Austin, Texas

PostPosted: Sun Jun 17, 2012 6:01 pm    Post subject: New Release: KWEEPOUT Reply with quote



http://www.kweepa.com/step/vic20/games/kweepout.prg

A version of Breakout (oops!) written in BASIC for the unexpanded VIC.
This was an experiment to see how much I could fit into a BASIC program.
Loosely inspired by this presentation:
http://www.youtube.com/watch?v=Fy0aCDmgnxg
Let me know what you think!


Last edited by Kweepa on Wed Jun 20, 2012 1:36 pm; edited 4 times in total
Back to top
View user's profile Send private message
TBCVIC
Vic 20 Hobbyist


Joined: 05 Mar 2009
Posts: 114
Location: Stockholm, Sweden

PostPosted: Mon Jun 18, 2012 2:30 am    Post subject: Reply with quote

Very nice! Though that's not Pong, that's Breakout.
_________________
Ola Andersson
Back to top
View user's profile Send private message
Kweepa
Vic 20 Nerd


Joined: 04 Jan 2008
Posts: 811
Location: Austin, Texas

PostPosted: Mon Jun 18, 2012 8:00 am    Post subject: Reply with quote

TBCVIC wrote:
Though that's not Pong, that's Breakout.

DOH!
Back to top
View user's profile Send private message
Mayhem
High Bidder


Joined: 24 May 2004
Posts: 2167
Location: London, England

PostPosted: Mon Jun 18, 2012 9:48 am    Post subject: Reply with quote

Kweepout sounds a bit wrong though Wink
_________________
Lie with passion and be forever damned...
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Jeff-20
Denial Founder


Joined: 31 Dec 1969
Posts: 4974
Location: Chicago

PostPosted: Mon Jun 18, 2012 10:32 am    Post subject: Reply with quote

Mayhem wrote:
Kweepout sounds a bit wrong though Wink


HAHAHA! That would get my attention a bit faster though!

I look forward to playing this!
_________________
High Scores, Links, and Jeff's Basic Games page.
Back to top
View user's profile Send private message Visit poster's website
tokra
Vic 20 Afficionado


Joined: 27 Apr 2010
Posts: 416
Location: near Bremen, Germany

PostPosted: Mon Jun 18, 2012 6:05 pm    Post subject: Reply with quote

Nice one! Always pleasantly surprised by your versatility! Action (Doom), Text Adventure (Cometfall), Jump & Run (Blue Star) and now you even rival the Jeff's BASIC skills!

I managed to finish level one but in level two the screen started going crazy. The blanks in the background were replaced with another char, and after a few minutes even the ball was gone. Probably string-variables creeping into the character definitions (since those are written from the top down). Looks like you did not protect your character-definition by something like

Code:
POKE56,28:CLR

like most programs do.
Back to top
View user's profile Send private message Visit poster's website
Kweepa
Vic 20 Nerd


Joined: 04 Jan 2008
Posts: 811
Location: Austin, Texas

PostPosted: Mon Jun 18, 2012 6:26 pm    Post subject: Reply with quote

Gah!
I deliberately didn't do that, because I needed all the space below for the program and variables.
I'm only using one string variable, A$, and during gameplay it's only used to hold the score, so I'm not sure how it keeps growing... Any ideas? There should be 248 bytes free between the space character and the screen.
Back to top
View user's profile Send private message
GreyGhost
Vic 20 Afficionado


Joined: 05 Oct 2005
Posts: 446
Location: Ladson,SC

PostPosted: Mon Jun 18, 2012 7:20 pm    Post subject: Reply with quote

Could you use some of that free space to save the score there. Then read it like you would a low byte - high byte. I haven't played the game yet so I'm not sure how high the score can go, but 3 bytes can hold a number over 15 million.

score = peek(byte 1)+peek(byte 2)*256+peek(byte 3)*65536

Of course it will take a bit of memory to calculate.

if byte 1>256 then byte 2 = byte 2 + 1
if byte 2 >256 then byte 3 = byte 3 + 1
_________________
Rob
Back to top
View user's profile Send private message Visit poster's website
Ghislain
Realms of Quest


Joined: 08 Aug 2004
Posts: 794
Location: Calgary, Alberta, Canada

PostPosted: Tue Jun 19, 2012 12:49 am    Post subject: Reply with quote

I really should get an sd2iec device so I can try these new games that are coming out. A couple of years ago I made it a point to transfer all of the 'New Releases' via USB to 1541 cable. Emulation is fine, but when you have a real hardware setup, you tend to just want to actually play the games on real hardware.

So I'm going to order an sd2iec device right now. Maybe a second one for my C64 as well. I'm sort of tired of always trying to keep track of what game or program is on which disk, etc.
_________________
"A slave is one who waits for someone to come and free him." -- Ezra Pound
Back to top
View user's profile Send private message Visit poster's website
matsondawson
The Most Noble Order of Denial


Joined: 01 May 2009
Posts: 341
Location: Wellington, New Zealand

PostPosted: Tue Jun 19, 2012 1:49 am    Post subject: Reply with quote

tokra wrote:

I managed to finish level one but in level two the screen started going crazy. The blanks in the background were replaced with another char, and after a few minutes even the ball was gone.


Ah, on my emulator it's immediately broken. Must be because I launch the program by loading it into ram, then sys'ing it.

http://www.mdawson.net/vic20chrome/vic20.php?load=http://www.kweepa.com/step/vic20/games/kweepong.prg&machineType=pal
Back to top
View user's profile Send private message
tokra
Vic 20 Afficionado


Joined: 27 Apr 2010
Posts: 416
Location: near Bremen, Germany

PostPosted: Tue Jun 19, 2012 2:49 am    Post subject: Reply with quote

Kweepa wrote:
I'm only using one string variable, A$, and during gameplay it's only used to hold the score, so I'm not sure how it keeps growing... Any ideas?

Yes, I see the problem. You use:

Code:
A$=STR$(K)

However, this will always reserve new space in memory for A$, until the memory is full and the garbage collection kicks in. To avoid this you can force a garbage collection by caling the FRE(0) function:

Code:
F=FRE(0)


I also noticed you poke the new character set into RAM with your program. You may just include the character set with the file and start with

Code:
POKE45,x:POKE46,y:CLR

where x and y are the true ending of the program. However this might go against your "pure" BASIC agenda
Back to top
View user's profile Send private message Visit poster's website
GreyGhost
Vic 20 Afficionado


Joined: 05 Oct 2005
Posts: 446
Location: Ladson,SC

PostPosted: Tue Jun 19, 2012 6:06 am    Post subject: Reply with quote

Also, if you change:
Code:
1 v=36874:fori=.to5:readx:pokev+i,x:next
76 data0,0,0,0,15,14


to:
Code:
1 v=36874:pokev,0:pokev+1,0:pokev+2,0:pokev+3,0:pokev+4,15:pokev+5,14


You will save 10 bytes. Unless their is another reason you did it like that.

You can also put the new character data starting at location 7424.

Then:
Code:
poke52,29:poke56,29:clr


Your first character defined would have to be a space character, and your custom characters will start with the value 32(space), but it will save 256 bytes. And you still have the regular set when reversed.

Hope that is explained ok.

EDIT:
2 more bytes, you have "thengoto" in lines 63 & 64.
_________________
Rob


Last edited by GreyGhost on Tue Jun 19, 2012 1:24 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
Kweepa
Vic 20 Nerd


Joined: 04 Jan 2008
Posts: 811
Location: Austin, Texas

PostPosted: Tue Jun 19, 2012 7:36 am    Post subject: Reply with quote

Thanks for the detailed analysis!
I had no idea there was lazy garbage collection! You (I) live and learn!
Including the character set definitely goes against my "true" agenda which is a single, type-in-able, file.
For setting the sound and border, unless I'm miscounting, using a loop and data statement (which I combined with existing data) takes 4 bytes less than 6 pokes.
I tried moving the character set further up in memory but without the FRE(0) the definitions got massacred instantly. I know how to fix it now though Smile
THENGOTO? Oops! Amateur hour!
I'll knock up a new version soon.

Oh, and for the emulated version, I realize now that I'm using the space character undefined, so it's liable to end up garbage. In VICE it seemed to be ok.
Back to top
View user's profile Send private message
Jeff-20
Denial Founder


Joined: 31 Dec 1969
Posts: 4974
Location: Chicago

PostPosted: Tue Jun 19, 2012 9:08 am    Post subject: Reply with quote

Ghislain wrote:
I really should get an sd2iec device so I can try these new games that are coming out.


You should! For me, everything is straight to a real Vic now. It's great!
_________________
High Scores, Links, and Jeff's Basic Games page.
Back to top
View user's profile Send private message Visit poster's website
GreyGhost
Vic 20 Afficionado


Joined: 05 Oct 2005
Posts: 446
Location: Ladson,SC

PostPosted: Tue Jun 19, 2012 1:35 pm    Post subject: Reply with quote

Kweepa wrote:
For setting the sound and border, unless I'm miscounting, using a loop and data statement (which I combined with existing data) takes 4 bytes less than 6 pokes.


Opps. guess early morning hours must be to blame. I am getting a different result than I did last night.

Anyway, gratz on getting it working correctly.
_________________
Rob
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Denial Forum Index -> Games All times are GMT - 6 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group