Jump to content

Photo

MidSpace for Intv (was: "A random sprite?")


7 replies to this topic

#1 atari2600land OFFLINE  

atari2600land

    My favorite channel is Channel F.

  • 11,785 posts
  • It's groovy.
  • Location:Salem, Oregon

Posted Sat Apr 20, 2019 6:46 PM

How do I make a sprite's shape random?

What I'm looking for is an effect like the qotile shield in Yars' Revenge. I tried various things and nothing did anything. I want to make Sprite 1 fire coming out of a rocket, but I can't. Any help?



#2 artrag OFFLINE  

artrag

    Stargunner

  • 1,286 posts

Posted Sun Apr 21, 2019 3:19 AM

Intybasic allows you to point to a ram array while using Define

Just fill that ram array with random data, use the random function that is updated at each call, not the one updated once per frame 

 

If it is too slow, just pre-compute in ROM the frames of random noise and plot them as a normal animation 



#3 mr_me OFFLINE  

mr_me

    River Patroller

  • 4,193 posts
  • Location:Ontario

Posted Sun Apr 21, 2019 5:11 AM

Scroll through grom 213 to 255.

#4 fsuinnc OFFLINE  

fsuinnc

    Moonsweeper

  • 489 posts
  • Location:Chapel Hill NC.

Posted Sun Apr 21, 2019 9:07 AM

These are all good.  Another thing that might help is to us the X flip and Y flip bits in the Sprite command.  Varying the X and Y flip along with the random sprites can be a bit jumpy, which sometimes works for what you're doing, but gives you more frames from a limited number of grom or gram elements.



#5 carlsson OFFLINE  

carlsson

    Metagalactic Mule

  • 8,983 posts
  • Location:Västerås, Sweden

Posted Sun Apr 21, 2019 1:13 PM

Here is a suggestion for a random sprite, using the VARPTR syntax like Artrag mentioned.
 
Enable the sequence if you want the random junk to move like exhausts, or follow the other path to generate entirely random patterns.
 
And yes, I love magic numbers so I didn't use constants this time.

Edit: Of course you don't need a delay if you have rest of the program taking up time, but for this simple example the graphic will flush extremely fast without the delay.
 
  REM Random sprite
  DIM #ss(3)
  counter=0:delay=4:sequence=1
  MODE 1:SPRITE 0,100 + $200,50 + $100,256*8 + 7:WAIT
 
loop:
  IF counter=0 THEN
    IF sequence=1 THEN
      #ss(0)=#ss(1):#ss(1)=#ss(2):#ss(2)=#ss(3)
      #ss(3)=RANDOM(256)*256 + RANDOM(256)
    ELSE
      #ss(0)=RANDOM(256)*256 + RANDOM(256)
      #ss(1)=RANDOM(256)*256 + RANDOM(256)
      #ss(2)=RANDOM(256)*256 + RANDOM(256)
      #ss(3)=RANDOM(256)*256 + RANDOM(256)
    END IF
    DEFINE 0,1,VARPTR #ss
  END IF
 
  WAIT
 
  counter=counter+1
  IF counter>delay THEN
    counter=0
  END IF
 
  GOTO loop
 
Attached File  random_sprite.bas   629bytes   5 downloads

Edited by carlsson, Sun Apr 21, 2019 1:16 PM.


#6 atari2600land OFFLINE  

atari2600land

    My favorite channel is Channel F.

  • Topic Starter
  • 11,785 posts
  • It's groovy.
  • Location:Salem, Oregon

Posted Sun Apr 21, 2019 4:33 PM

Thanks for the help. I'm making a new game called "MidSpace", based on my Game Boy game I made, then tried to make for the Odyssey 2, and then I failed on it, so now I'm attempting to make it for the Intellivision. Things are going along way better than when I was trying to make the game on the Odyssey 2 due to INTVBasic.

 

I made the title screen, now I'm working on the game itself. I want to have a DEMO mode where it plays itself, but I don't know if I will do that or not. So you can press a fire button and start the game. You can move the rocket right or left and make it face up or down by pressing up or down on the joystick. Firing is done using buttons. The UFO's lasers are not deadly yet. Anyway, let me know what you think so far.

Attached Files



#7 atari2600land OFFLINE  

atari2600land

    My favorite channel is Channel F.

  • Topic Starter
  • 11,785 posts
  • It's groovy.
  • Location:Salem, Oregon

Posted Mon Apr 22, 2019 2:54 PM

The UFOs are deadly. And I have a giant mouth as a boss now. It's deadly too. I'll leave it up to you to figure out how to defeat the mouth.

 

Attached Files



#8 cmadruga OFFLINE  

cmadruga

    Space Invader

  • 49 posts
  • Location:Akron, OH USA

Posted Fri May 17, 2019 8:06 PM

I found a way to defeat the mouth, but I'm not telling anyone!




0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users