Need help converting my C game to Hollywood, looking for suggestions.
-
MarisaG1967
- Posts: 24
- Joined: Sat Jun 22, 2024 4:15 am
- Location: South San Francisco, CA
- Contact:
Need help converting my C game to Hollywood, looking for suggestions.
First question:
What is the recommended method to convert structs to "hollywood method"
Will edit to add more questions as they come up...
What is the recommended method to convert structs to "hollywood method"
Will edit to add more questions as they come up...
--- https://amigacity.xyz - Website for all things related to the Amiga
--- https://hollywood.retro-os.live - Fan site for the Hollywood programming environment
--- https://discord.gg/ExmkwrV8ZA - Discord for Hollywood fans
--- https://hollywood.retro-os.live - Fan site for the Hollywood programming environment
--- https://discord.gg/ExmkwrV8ZA - Discord for Hollywood fans
Re: Need help converting my C game to Hollywood, looking for suggestions.
Tables.
You have two syntax variants. The second looks similar to the C struct access. From the manual:
You have two syntax variants. The second looks similar to the C struct access. From the manual:
Code: Select all
a = {} ; create empty table
a["name"] = "John Doe" ; assign "John Doe" to index "name"
a.name = "John Doe" ; assign "John Doe" to index "name"
b = a["name"]
b = a.name
-
MarisaG1967
- Posts: 24
- Joined: Sat Jun 22, 2024 4:15 am
- Location: South San Francisco, CA
- Contact:
Re: Need help converting my C game to Hollywood, looking for suggestions.
Thanks! Will give that a try!
--- https://amigacity.xyz - Website for all things related to the Amiga
--- https://hollywood.retro-os.live - Fan site for the Hollywood programming environment
--- https://discord.gg/ExmkwrV8ZA - Discord for Hollywood fans
--- https://hollywood.retro-os.live - Fan site for the Hollywood programming environment
--- https://discord.gg/ExmkwrV8ZA - Discord for Hollywood fans
-
MarisaG1967
- Posts: 24
- Joined: Sat Jun 22, 2024 4:15 am
- Location: South San Francisco, CA
- Contact:
Re: Need help converting my C game to Hollywood, looking for suggestions.
I'm assuming that this will work as well:
typeofstruct.structinstance.structfield.fieldvalue
?
typeofstruct.structinstance.structfield.fieldvalue
?
--- https://amigacity.xyz - Website for all things related to the Amiga
--- https://hollywood.retro-os.live - Fan site for the Hollywood programming environment
--- https://discord.gg/ExmkwrV8ZA - Discord for Hollywood fans
--- https://hollywood.retro-os.live - Fan site for the Hollywood programming environment
--- https://discord.gg/ExmkwrV8ZA - Discord for Hollywood fans
Re: Need help converting my C game to Hollywood, looking for suggestions.
Code: Select all
typeofstruct={}
typeofstruct.structinstance={}
typeofstruct.structinstance.structfield={}
typeofstruct.structinstance.structfield.fieldvalue=123
NPrint(typeofstruct.structinstance.structfield.fieldvalue)
ForEach(typeofstruct, NPrint)
ForEach(typeofstruct.structinstance, NPrint)
ForEach(typeofstruct.structinstance.structfield, NPrint)
NPrint("")
; shorter version:
typeofstruct={structinstance={structfield={fieldvalue=345}}}
NPrint(typeofstruct.structinstance.structfield.fieldvalue)
ForEach(typeofstruct, NPrint)
ForEach(typeofstruct.structinstance, NPrint)
ForEach(typeofstruct.structinstance.structfield, NPrint)
WaitLeftMouse()
-
MarisaG1967
- Posts: 24
- Joined: Sat Jun 22, 2024 4:15 am
- Location: South San Francisco, CA
- Contact:
Re: Need help converting my C game to Hollywood, looking for suggestions.
Interesting suggestion, thanks!
--- https://amigacity.xyz - Website for all things related to the Amiga
--- https://hollywood.retro-os.live - Fan site for the Hollywood programming environment
--- https://discord.gg/ExmkwrV8ZA - Discord for Hollywood fans
--- https://hollywood.retro-os.live - Fan site for the Hollywood programming environment
--- https://discord.gg/ExmkwrV8ZA - Discord for Hollywood fans
Re: Need help converting my C game to Hollywood, looking for suggestions.
By the way, have you already decided how the game's graphics will be designed? As far as I can see, there are two fundamentally different approaches in Hollywood. The classic approach, where an image is constantly being rebuilt and synchronized with the vertical sync, and the later layer functions, which are more suited to more powerful graphics hardware. I've done everything with layers so far, but I've never built a game, and I didn't have the Amiga as my target platform for my current project..
-
MarisaG1967
- Posts: 24
- Joined: Sat Jun 22, 2024 4:15 am
- Location: South San Francisco, CA
- Contact:
Re: Need help converting my C game to Hollywood, looking for suggestions.
It's a card game so animation will be minimal at first and maybe added on later. I'm thinking sprites for now. I'm targeting amiga/mac/Linux and maybe even windows.
--- https://amigacity.xyz - Website for all things related to the Amiga
--- https://hollywood.retro-os.live - Fan site for the Hollywood programming environment
--- https://discord.gg/ExmkwrV8ZA - Discord for Hollywood fans
--- https://hollywood.retro-os.live - Fan site for the Hollywood programming environment
--- https://discord.gg/ExmkwrV8ZA - Discord for Hollywood fans
Re: Need help converting my C game to Hollywood, looking for suggestions.
For a card game, I think any approach will work.
- Juan Carlos
- Posts: 932
- Joined: Mon Sep 06, 2010 1:02 pm
Re: Need help converting my C game to Hollywood, looking for suggestions.
To make a card game may be easier start it all from Hollywood, although it is true that the poker engines is more easy to try adapt it from C, I tryed to make a Texas Holdem Poker but it was a little complicated for me the CPU engine as rival and convert a example from C or Java is complicated. But to make a easy card game the best option is 100% Hollywood using layers to visual effects.