English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. AMOS

 
 
Thread Tools
Old 30 May 2021, 17:41   #1
alain.treesong
Aghnar
 
Join Date: Jan 2019
Location: France
Posts: 153
AMOS examples

I've just created a repo on github where I will regularly put Amos (short) sources. Some of them will be extracted from the demos I make from time to time :
https://github.com/alain-treesong/amiga_coding_in_amos

These sources are made to work in Amos pro with two extensions that have become standard (amcaf and amos turbo). I put a link in the main page to download a version of Amos Pro with these extensions.
The target platform is A500 vanilla but it should work on most of the configuration.

Second example : a rotating star extracted from "Happy new year 2021" :
Click image for larger version

Name:	star.png
Views:	239
Size:	4.6 KB
ID:	72128

I think some cool demoscene relative things can be done in Amos so perhaps some coder will find theses sources usefull...
alain.treesong is offline  
Old 30 May 2021, 19:12   #2
kriz
Junior Member
 
kriz's Avatar
 
Join Date: Sep 2001
Location: No(R)Way
Age: 41
Posts: 3,185
Really nice, will follow with great interest!
kriz is offline  
Old 06 June 2021, 18:32   #3
alain.treesong
Aghnar
 
Join Date: Jan 2019
Location: France
Posts: 153
Dual playfield

Here is a new example : https://github.com/alain-treesong/am...eDualPlayfield
Click image for larger version

Name:	dualPlayfield.png
Views:	295
Size:	17.6 KB
ID:	72217

This a simple dual playfield scrolling with the nice graphics of Ansimuz.

In a next example, I will add a third animated static background.
alain.treesong is offline  
Old 12 June 2021, 23:08   #4
alain.treesong
Aghnar
 
Join Date: Jan 2019
Location: France
Posts: 153
Third playfield example

Hi,

I've uploaded a 4th code example : a trial playfield.
Some explanation and source here : https://github.com/alain-treesong/am...threePlayfield

Here is a little video of this example in action :
[ Show youtube player ]

Aghnar

Last edited by alain.treesong; 13 June 2021 at 14:07.
alain.treesong is offline  
Old 14 June 2021, 15:14   #5
kriz
Junior Member
 
kriz's Avatar
 
Join Date: Sep 2001
Location: No(R)Way
Age: 41
Posts: 3,185
Thanks, very nice!
kriz is offline  
Old 29 November 2021, 00:00   #6
alain.treesong
Aghnar
 
Join Date: Jan 2019
Location: France
Posts: 153
Vector balls

Hi,
I've just pushed a new example. This time this is a little vector balls scene.

You can find the source here :
https://github.com/alain-treesong/am...05_vectorBalls

A video of the result :
[ Show youtube player ]

SeeU
alain.treesong is offline  
Old 12 December 2021, 19:25   #7
alain.treesong
Aghnar
 
Join Date: Jan 2019
Location: France
Posts: 153
Hi,

New entry in the repository, an horizontal scroll text algo with a cool font :
https://github.com/alain-treesong/am...ntalScrollText

Click image for larger version

Name:	multiScroll.png
Views:	153
Size:	8.9 KB
ID:	74067

Bye
alain.treesong is offline  
Old 21 December 2021, 16:13   #8
chrisbeeley
Registered User
 
Join Date: Sep 2021
Location: Nottingham, UK
Posts: 8
Nice, thanks for this.


I'm trying to learn AMOS coming from R/ Python and I am finding it hard to find examples to this is great
chrisbeeley is offline  
Old 21 December 2021, 16:20   #9
Pyromania
Moderator
 
Pyromania's Avatar
 
Join Date: Jan 2002
Location: Chicago, IL
Posts: 3,375
Great examples thank you. I never knew AMOS Pro was so good at Parallax scrolling!
Pyromania is offline  
Old 22 December 2021, 10:44   #10
alain.treesong
Aghnar
 
Join Date: Jan 2019
Location: France
Posts: 153
Thanks @kriz, @chrisbeeley, @Pyromania

@Pyromania
All the demos done by "Agima" are coded in Amos and run on a "normal" A500 512K/512K. You can see them in pouet.net or demozoo.org.

I will continue of course to publish some examples in 2022.
alain.treesong is offline  
Old 31 December 2021, 13:22   #11
alain.treesong
Aghnar
 
Join Date: Jan 2019
Location: France
Posts: 153
Hi,

Here is a demo, that can be found in the zone or on usual website like demozoo :
https://demozoo.org/productions/303755/
Click image for larger version

Name:	happy22_005.png
Views:	158
Size:	14.8 KB
ID:	74269

This demo gathers some examples of the code that I spoke about in this thread and that are available in the github repo (https://github.com/alain-treesong/amiga_coding_in_amos)
I added two or three lines of code between the scenes to make it a bit prettier.
I will add some new snippets in 2022 of course.

Happy new year

Aghnar / Agima
alain.treesong is offline  
Old 31 December 2021, 13:37   #12
kriz
Junior Member
 
kriz's Avatar
 
Join Date: Sep 2001
Location: No(R)Way
Age: 41
Posts: 3,185
Sweet stuff, thanks and keep the tutorials coming.. Happy new year Aghnar!
kriz is offline  
Old 16 January 2022, 15:32   #13
alain.treesong
Aghnar
 
Join Date: Jan 2019
Location: France
Posts: 153
Hello,
New entry in the repo github, this time about music :
https://github.com/alain-treesong/am...impleMusicDisk

A quick video about that :
[ Show youtube player ]

Click image for larger version

Name:	quickMusicDisk.png
Views:	139
Size:	7.9 KB
ID:	74424
alain.treesong is offline  
Old 11 February 2022, 13:20   #14
CaptainNow
Eleventh Hour Games
 
CaptainNow's Avatar
 
Join Date: Feb 2011
Location: Carnforth, England
Age: 49
Posts: 558
Brilliant! Thank you for these!
CaptainNow is offline  
Old 16 May 2022, 20:45   #15
alain.treesong
Aghnar
 
Join Date: Jan 2019
Location: France
Posts: 153
Simple 3d wire cube

Thanks Captain !

And here is a new little source. This one, a simple and classic 3d cube.

A little vid about that :
[ Show youtube player ]

Source here :
Github

Click image for larger version

Name:	simple3DCube.png
Views:	90
Size:	3.9 KB
ID:	75595
alain.treesong is offline  
Old 31 July 2022, 23:57   #16
GamerGrug
Registered User
 
Join Date: Jul 2022
Location: Australia
Posts: 7
Hi all!
Thanks Alain for the great examples.
I am fairly new to AMOS (and loving it!). I noticed in the manual for AMCAF mention of a starfield generator. I am trying to get an example working with horizontal animated stars as a background for a space shooter. Any chance someone could post a working example for me to follow??
Thanks!
GamerGrug is offline  
Old 01 August 2022, 06:20   #17
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
AMCAF starfields are first-person, not sideways. You might have to settle for using the Turbo Draw commands in AMCAF.
Samurai_Crow is offline  
Old 01 August 2022, 09:31   #18
alain.treesong
Aghnar
 
Join Date: Jan 2019
Location: France
Posts: 153
Amos turbo and Amcaf

Hello @GamerGrug

2 classical extensions are included in Amos Community :
Amcaf : which has the "td stars" instructions
Amos turbo : which has the stars instruction

I attached the doc and example of amos turbo : some example like star_snow will be interesting for you.
docs_turbo.zip

One limitation for turbo is that stars are drawn only in first bitplane. But using set bobs command or dual playfied, you will be able to manage that.

Amcaf contains also command for stars as you said. You can download this distib on aminet (some stars example inside):
https://aminet.net/package/dev/amos/AMCAFExt140Exa

Bye
alain.treesong is offline  
Old 01 August 2022, 11:06   #19
DisasterIncarna
Registered User
 
DisasterIncarna's Avatar
 
Join Date: Oct 2021
Location: England
Posts: 1,171
my own low effort attempt, just pasting bobs of dots
it auto does different speeds/planes of stars, just have

STARFIELDS = how many planes you want, PLANE1 is always
the fastest, extra ones are slower, speed auto calculated.

STARSPERFIELD = how many dots/stars you want per field.

So you can set them low and quick or over the top till you crash, nothing
else is required except setting those 2 values, there is a STARSPEED
value farther in you can mess with, which is the initial/fastest speed.

This is an example of zero practical use for anyone, i just wanted to try anyways,
never actually made one before, made this in an emulator and at a guess this
will probably choke a real amiga to death.

EDIT: Fixed stupid errors, had it drawing offscreen which is dumb, fixed that, also
the max number of starfield "planes" was technically the max number of screen
colors, as i had it use a different ink color per plane, now you can specify any
number of planes and the colors are simply randomised if the number of planes
exceeds the screen colors/depth.

[ Show youtube player ]

Code:
Rem STARFIELDS controls how many planes of stars there are 
Rem Each plane moves at a different speed
Rem -----
Rem STARSPERFIELD controls how many stars are drawn on each
Rem Starfield plane, excessive numbers will slow things down.

Set Buffer 80000

STARFIELDS=20
STARSPERFIELD=5

FIRSTSTART=True

Fix(2)

Dim STARLR#(STARFIELDS,STARSPERFIELD)
Dim STARUD#(STARFIELDS,STARSPERFIELD)

Global STARLR#(),STARUD#()
Global STARFIELDS,STARSPERFIELD,FIRSTSTART

Screen Open 0,320,256,8,Lowres
Paper 0
Flash Off 

Palette 0,$222,$444,$666,$A2A,$2AA,$AA2,$FFF
Double Buffer 
Autoback 0
Hide 
Cls 0
Get Rom Fonts 
Set Font 1

Rem Grab Some Bobs to use as stars we will later paste 
MAKESTARS

Repeat 
Bob Update Off 
Sprite Update Off 

Rem Do the starfield thing 
STARFIELD

Rem Do other clever stuff here 
OVERLAYTEXT

Bob Update On 
Sprite Update On 
Wait Vbl 
Screen Swap 
Until Inkey$=" "

Show 
End 

Procedure STARFIELD
Rem Avoid blank screen, instead fill screen with a starfield   
Rem Rather than have it scroll into play gradually...

If FIRSTSTART=True
For ZX=0 To STARFIELDS-1
  For ZZ=0 To STARSPERFIELD-1
    STARLR#(ZX,ZZ)=Rnd(Screen Width)
    STARUD#(ZX,ZZ)=Rnd(Screen Height)
  Next ZZ
Next ZX
FIRSTSTART=False
End If 

Rem Scroll visible stars left in crappy parallax effect
Rem ----   
Rem Set fastest speed allowed  
Rem And set how slower stars get per plane 

STARSPEED#=3
STARSTEP#=(STARSPEED#)/(STARFIELDS)

Cls 0
For ZX=0 To STARFIELDS-1
  For ZZ=0 To STARSPERFIELD-1
    If STARLR#(ZX,ZZ)>-10
      STARLR#(ZX,ZZ)=STARLR#(ZX,ZZ)-STARSPEED#
    Else 
      STARLR#(ZX,ZZ)=Screen Width+Rnd(Screen Width)
      STARUD#(ZX,ZZ)=Rnd(Screen Height)
    End If 
    If STARLR#(ZX,ZZ)>-1 and STARLR#<(Screen Width+1)
      Paste Bob STARLR#(ZX,ZZ),STARUD#(ZX,ZZ),1+((STARFIELDS-1)-ZX)
    End If 
  Next ZZ
  STARSPEED#=STARSPEED#-STARSTEP#
Next ZX
End Proc

Procedure MAKESTARS
Rem Make stars and other random stuff we can paste to the screen 
For ZZ=0 To STARFIELDS-1
  CLRTOUSE=ZZ+1
  If ZZ>Screen Colour
    CLRTOUSE=Rnd(Screen Colour)+1
  End If 
  Cls 0
  Plot 0,0,CLRTOUSE
  Get Bob ZZ+1,0,0 To 1,1
Next 
Cls 0

Gr Writing 0

TXT$="Lives: 3"
Ink 1,0
Text 1,6,TXT$
Text 1,8,TXT$
Text 0,7,TXT$
Text 2,7,TXT$
Ink 7,0
Text 1,7,TXT$
Get Bob STARFIELDS+1,0,0 To Text Length(TXT$)+1,13
Cls 0

TXT$="Score: 1,234,567"
Ink 1,0
Text 1,6,TXT$
Text 1,8,TXT$
Text 0,7,TXT$
Text 2,7,TXT$
Ink 7,0
Text 1,7,TXT$
Get Bob STARFIELDS+2,0,0 To Text Length(TXT$)+1,13
Cls 0
End Proc

Procedure OVERLAYTEXT
Paste Bob 20,Screen Height-20,STARFIELDS+1
Paste Bob Screen Width-150,Screen Height-20,STARFIELDS+2
End Proc

Last edited by DisasterIncarna; 07 September 2022 at 20:11.
DisasterIncarna is offline  
Old 01 August 2022, 12:42   #20
GamerGrug
Registered User
 
Join Date: Jul 2022
Location: Australia
Posts: 7
Hi all, WOW! I really appreciate the replies. I'll let you know how I go!
Thank you all!!!!!
GamerGrug is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Wip] Amos Professional X : Bring AGA to Amos Pro! freddix Coders. AMOS 53 22 July 2023 09:53
AMOS Files from Writing RPG's in AMOS supercruiser request.Other 0 21 April 2020 13:03
Any good AMOS examples and tutorials? amiman99 Coders. AMOS 14 03 April 2016 05:36
Plasma examples anyone? jobro Coders. General 5 27 November 2005 17:25
Where's the amos.library on the 3-disk AMOS set? andreas support.Apps 0 15 November 2001 16:04

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 20:53.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09903 seconds with 16 queries