Jump to content

Dalta

New Members
  • Content Count

    21
  • Joined

  • Last visited

Community Reputation

8 Neutral

About Dalta

  • Rank
    Space Invader

Profile Information

  • Gender
    Not Telling
  • Location
    France
  1. Thanks for that help. I don't know what happened with configuring the controller inputs, the first time or two I loaded Studio Code it didn't remember the settings, but then after that, it did. So, problem solved I guess.
  2. Hey would someone mind explaining a part of this code further please? Particularly, these two lines: if HeroX <= BulletX[z] then BulletDirection[z] = BulletDirection[z] | %00000010 else BulletDirection[z] = BulletDirection[z] & %11111101 if HeroY <= BulletY[z] then BulletDirection[z] = BulletDirection[z] | %00000001 else BulletDirection[z] = BulletDirection[z] & %11111110 I understand what an 'and' and 'or' operation is, but I don't understand what's actually happening here. I copied these lines into my own code to see what happens. I had to flip the '<' signs and I also replaced 'BulletX' and Y with the 'enemyX' and Y variables. But after that my enemy sprites only fired imprecisely and only down and to the right. Does anyone know why I got that behaviour in my code as opposed to the precise shooting in this code? It's probably worth mentioning that I have two direction variables, one for up/down and one for left/right rather than just 'BulletDirection' which seems to be the case here. I think I just need to alter the part after the 'else' to get it to fire up and left too, but unfortunately I don't know what's actually happening in order to change it. Thanks for any help
  3. Is there a way to have the settings from the previous session become the default settings? i.e. The default programming language is currently bataribasic, currently I have to re-set the language to 7800basic every time I open Code Studio. This is also true of the settings for A7800, i.e. I have to reconfigure my joypad controls on A7800 every time I open Code Studio. Is there some way to set these as default I haven't seen, or is there some way it could be implemented? Also, the A7800 launches as the NTSC 7800, is there a way to get the PAL version to be what launches instead? Thanks for the work, I haven't installed the sprite editor version, but that looks really useful.
  4. Thanks for your work. Looking forward to trying it out.
  5. Cool, no problem. I'm eternally grateful just for 7800basic's existence, I never would've made much progress if I was still struggling with assembly.
  6. Thanks for that help, don't know why I didn't just create a new variable, I guess I was too focused on figuring out a solution to the problem. Now that you mention it, I ran into two other issues that seem related, perhaps it will be helpful to you. One was when I was trying to implement some simple collision with a bullet and had a line that was something like if bullx>ex && bullx<ex+8 && bully>ey && bully<ey+16 then goto BulletInactive with ex being the enemy x position, and ex+8 being the enemy's width with ey the corresponding measures for the y axis. This code wouldn't run and I had to replace ex+8 with a new variable eh (enemy height) which was equal to the same thing. I copied this line or something similar from the http://www.randomterrain.com/7800basic.htmlwebsite, but I've looked through and I can't find anything like it now so I'm not sure what part I got it from. The other time wasn't an if statement but is kind of similar, it was with the plotsprite command. I had plotsprite enemy 0 ex[eco] ey[eco] but it wouldn't run, so I had to create a single use 'nex' variable which is equal to ex[eco] and ditto for ey to replace them in that statement. This is the same for all my plotsprite commands.
  7. So I've had another problem with this section of code. I was implementing multiple base blocks, so I made every variable into an array to accommodate each base block. The only change to the code I made was adding [bco] after the variable names. [bco] is the counter I use to loop through each array in order to manipulate each block. This broke the code, but it seems to be the specific configuration 'playerx+15>basex[bco]' that doesn't work (and presumably the playery equivalent), I've tested the other operations and they seem to work fine. Switching the signs to their opposite also works fine, and replacing the operation with playerx>basex[bco]-15 works, but causes the same problems as in my original post. When I say the code doesn't work, it never evaluates 'playerx+15>basex[bco]' to true. if playerx<basex[bco]+15 && playerx+15>basex[bco] && playery<basey[bco]+10 && playery+10<basey[bco] then plotsprite face1 0 100 100:nearbase[bco]=1 else nearbase[bco]=0 if joy0fire1 && nearbase[bco]=1 then basex[bco]=playerx+4:basey[bco]=playery+4:basepickedup[bco]=1 else basepickedup[bco]=0 Anyone know what could be wrong?
  8. So sorry not to reply sooner, was travelling. Thank you for that explanation, I had read that before but hadn't thought of it as a possible reason for this bug. I implemented your suggested workaround and everything works as intended now. Thanks so much!
  9. Dalta

    Rikki & Vikki

    If you don't mind me asking, did you ever consider doing a kickstarter to fund production? If so why did you decide against it?
  10. Sorry couldn't think of a better title. So, I'm trying to implement moving and placing blocks in order to place them as defenses in front of the player's base. I wrote a simple code, just two lines, so that when the player's x and y are within a range of the block's x and y (15 pixels on the x, 10 on the y), and then the player presses a button, the block will jump to be 4 pixels away from the player's x and y ("carrying" the block). Everything works fine until the block gets to blockx=14 (and blocky=9) when the the block will detach from the player (the variable 'nearbase' is no longer true) and will not allow itself to be picked up again (nearbase is never re-set as 1), even if the player's x and y go away from the edge of the screen. I used plotvalue to display that the variables for player and base x and y are correct, stay what they should be and stay within range. There is no problem on the other end of the screen, only in the lower numbers. When the strange behaviour is happening, I ask (via plotting a debug image) if the playerx is within range, it says it isn't, despite the plotvalue clearly showing that, in fact, it is. playerx and playery are dimensioned as a and b while blockx and blocky are $2557 and $2561 so it doesn't seem to be an overwriting issue. The block is called 'base' in the code, so blockx=basex. if playerx<basex+15 && playerx>basex-15 && playery<basey+10 && playery>basey-10 then nearbase=1 else nearbase=0 if joy0fire1 && nearbase=1 then basex=playerx+4:basey=playery+4:basepickedup=1 else basepickedup=0 Anyone know what's going on?
  11. Thank you for your help, that wasn't actually the error, I was still getting weird behaviour after I fixed the problem you mentioned. But I moved the line bx=bullx[x]: by=bully[x] to go after the peekchar lines (here: tempbx=bx/8:tempby=by/16 tempchar2=peekchar(screenram,tempbx,tempby,20,12) if player_bullets[x]=1 && tempchar2=2 then player_bullets[x]=0 if tempchar2=2 then plotsprite face1 0 0 50) and I got improved behaviour (though I don't understand why, it's like the latter lines above affected the assignment of bx and/or by). But anyway, I think I'm on to something here and I will pursue this for a while. If I need further help I will come back, thanks so much.
  12. Hope it's ok that I create a new thread each time I need help, I figured it would help people in future search if they're stuck on something. Anyway, I've created bullets for the player to shoot and now I'm trying to get the bullets to disappear when they hit a wall. I admit that I don't fully understand peekchar, but I get weird behaviour around line 29 in the below code. Before I put in the peekchar code, the bullets shoot from the player in whatever direction they're moving, as expected, but when I put in those peekchar lines around line 29 below, I get behaviour I don't understand. The appearance or otherwise of the bullet seems to depend on the player's position when in theory, that shouldn't affect it at all. The bullets also only appear when the player is on a certain side of the screen, not when they are touching a certain character, which is what I thought peekchar does. In theory it should be the character underneath either the player or the bullet which affects behaviour, no? Everything works fine until I set what 'tempbx' and 'tempby' are for the peekchar function. I put in a debug line which plots another face sprite which should match the same conditions as the bullet, but it appears at different times, seemingly random. On one run through the game crashed and plotted out a load of numbers at the top of the screen (this happened before during a different bug when I had mis-assigned a variable. I went through several times to make sure I hadn't done that this time and it doesn't look like it. It seems like there's something about peekchar that I don't understand. I tried to create a gif to illustrate the issue but apparently it's not allowed. My abridged code looks like the following: set collisionwrap on set doublewide on <assign variables> ; this next line is copied from Atarius Maximus's code dim screenram = $2200 : rem to $24EF (20*12=240 bytes) rem $24F0 to $27FF are free ;screen0map is the name of the map I made with alphachars memcpy screenram screen0map 240 plotmap screenram 1 0 0 20 12 savescreen main pprevx=playerx: pprevy=playery <movement code> if joy0fire0 && btimer=0 then gosub bullInit ; *** Plotting and Moving Bullets if firecon>10 then firecon=firecon-1 for x=0 to firecon ;giving variables to the bullets, in order to work in the if statement bx=bullx[x]: by=bully[x] ;check if the Bullet has hit a wall tempbx=bx/16:tempby=by/8 ;the bullets stop plotting for some reason after I enter this line tempchar2=peekchar(screenram,tempbx,tempby,20,12) if player_bullets[x]=1 && tempchar2=2 then player_bullets[x]=0 if tempchar2=2 then plotsprite face1 0 0 50 ;this is a debug line, though has weird behaviour too ;if the bullet is active, plot it and move it depending on it's direction for the next frame if player_bullets[x]=1 then plotsprite bullet 0 bx by: bullx[x]=bullx[x]+bdr[x]: bully[x]=bully[x]+bdd[x] next <some other code to prevent player moving off screen> if btimer>0 then btimer=btimer-1 plotsprite face1 0 playerx playery drawscreen goto main bullInit ;gives initial bullet variables bullx[firecon]=playerx: bully[firecon]=playery ; sets initial bullet coords at the player's coords player_bullets[firecon]=1 ;this basically sets the bullet to be active bdd[firecon]=playery-pprevy ;this sets the up/down velocity of the bullet depending on the player's movement bdr[firecon]=playerx-pprevx ;the same as above for left/right firecon=firecon+1 ; firecon keeps track of how many bullets there are btimer=10 ;this prevents too many bullets being plotted too quickly return ;checks for collision when player moves down checkmovedown tempx=(playerx+1)/8 tempy=(playery+8)/16 tempchar1=peekchar(screenram,tempx,tempy,20,12) if tempchar1=2 then return playery=playery+2:return <other code for player collision detection> alphachars ' [email protected]#$%^&*()_+-=[]{}:";<>,.?/' alphadata screen0map tileset_blanks2 ' ' ' ' 'aaaaaa aaaaaaaaa' ' ' ' aaaa ' ' aaaaaa ' ' ' ' aaaaa ' ' ' 'aaaaaaaaaa aaaa' ' ' ' ' end Thanks as always for any help.
  13. Dalta

    Rikki & Vikki

    Did you look into getting official licensing from Atari so you could put the logo, etc on the box like in the 80s?
  14. Anyone have a solution for implementing an array of bullets? In the sample code I've seen, usually a bullet sprite is plotted only while fire is held down, however I'd like for a bullet to be created when fire is pressed, and only disappear when it hits something or after a time limit. Normally to do this I would create an array of bullets and each time the fire button is pressed, add an item to that array, then when it's time to draw the screen, just do a for loop and plot each bullet before moving to the next. However, in 7800basic I can't seem to find a workaround, I think I've managed to create an array by declaring 'player_bullets[0]' as var0, with the intention of reserving 10 spaces, up to var9, for the players bullets, but I can't seem to even read an array element using a variable, i.e. I have a counter for the amount of bullets called 'bullcon', but referencing player_bullets[bullcon] returns an error. Can anyone help? Thank you
  15. Thanks a lot guys for the help. Yes, I thought about making a tile map originally, but I was just trying to get something quick and dirty up and running. Thanks for the link, I will go through and reformulate the code with its help. Edit: Ah, I've seen that link before haha, I was planning to come back to tiles and that after getting this game going, it looks my hand has been forced
×
×
  • Create New...